Class SndFile
Connects to DAGGER.SND to enumerate and extract sound data.
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class SndFile
Constructors
| Improve this Doc View SourceSndFile()
Default constructor.
Declaration
public SndFile()
SndFile(String, FileUsage, Boolean)
Load constructor.
Declaration
public SndFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to DAGGER.SND. |
File |
usage | Determines if the BSA file will read from disk or memory. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Fields
| Improve this Doc View SourceSampleRate
Declaration
public const int SampleRate = 11025
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceBsaFile
BSA file for sound effects.
Declaration
public BsaFile BsaFile { get; }
Property Value
Type | Description |
---|---|
Bsa |
Count
Number of BSA records in DAGGER.SND.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Filename
Gets default DAGGER.SND filename.
Declaration
public static string Filename { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceDiscardSound(Int32)
Discard a sound from memory.
Declaration
public void DiscardSound(int sound)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sound | Index of sound to discard. |
GetRecordIndex(UInt32)
Gets index of sound record with specified id.
Declaration
public int GetRecordIndex(uint id)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | id | ID of mesh. |
Returns
Type | Description |
---|---|
Int32 | Index of sound if located, or -1 if not found. |
GetSound(Int32, out DFSound)
Get a sound from index.
Declaration
public bool GetSound(int sound, out DFSound soundOut)
Parameters
Returns
Type | Description |
---|---|
Boolean | True if successful. |
GetStream(Int32)
Helper method to get an entire WAV file in a memory stream.
Declaration
public MemoryStream GetStream(int sound)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sound | Sound index. |
Returns
Type | Description |
---|---|
Memory |
Wave file in MemoryStream. |
IsValidIndex(Int32)
Quickly check if sound index in valid range.
Declaration
public bool IsValidIndex(int sound)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sound | Index of sound. |
Returns
Type | Description |
---|---|
Boolean | True if index is within a valid range. |
Load(String, FileUsage, Boolean)
Load DAGGER.SND file.
Declaration
public bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | Absolute path to DAGGER.SND file. |
File |
usage | Specify if file will be accessed from disk, or loaded into RAM. |
Boolean | readOnly | File will be read-only if true, read-write if false. |
Returns
Type | Description |
---|---|
Boolean | True if successful, otherwise false. |