@@ -12,9 +12,15 @@ Support for more encodings can be added as requested.
1212
1313The Fmod file can be read like this
1414``` c#
15+ // Will throw if the bank is not valid.
1516FmodSoundBank bank = FsbLoader .LoadFsbFromByteArray (rawData );
1617```
1718
19+ Or if you don't want it to throw if the file is invalid, you can use
20+ ``` c#
21+ bool success = FsbLoader .TryLoadFsbFromByteArray (rawData , out FmodSoundBank bank );
22+ ```
23+
1824You can then query some properties about the bank:
1925``` c#
2026FmodAudioType type = bank .Header .AudioType ;
@@ -26,6 +32,8 @@ And get the samples stored inside it:
2632List < FmodSample > samples = bank .Samples ;
2733int frequency = samples [0 ].Metadata .Frequency ; // E.g. 44100
2834uint numChannels = samples [0 ].Channels ; // 2 for stereo, 1 for mono.
35+
36+ string name = samples [0 ].Name ; // Null if not present in the bank file (which is usually the case).
2937```
3038
3139And, you can convert the audio data back to a standard format.
@@ -72,5 +80,6 @@ This project uses:
7280- [ OggVorbisEncoder] ( https://github.com/SteveLillis/.NET-Ogg-Vorbis-Encoder ) to build Ogg Vorbis output streams.
7381- [ NAudio.Core] ( https://github.com/naudio/NAudio ) to do the same thing but for WAV files.
7482- [ BitStreams] ( https://github.com/rubendal/BitStream ) for parsing vorbis header data.
83+ - [ IndexRange] ( https://github.com/bgrainger/IndexRange ) to make my life easier when supporting .NET Standard 2.0.
7584
7685It also uses System.Text.Json.
0 commit comments