Skip to content

Commit fc80e9f

Browse files
committed
Bump to 3.0.0, update README
1 parent 96155ae commit fc80e9f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Fmod5Sharp/Fmod5Sharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<Configurations>Release;Debug</Configurations>
77
<Platforms>x86;x64;AnyCPU</Platforms>
8-
<Version>2.0.2</Version>
8+
<Version>3.0.0</Version>
99
<PackageId>Fmod5Sharp</PackageId>
1010
<RepositoryType>git</RepositoryType>
1111
<RepositoryUrl>https://github.com/SamboyCoding/Fmod5Sharp.git</RepositoryUrl>

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ Support for more encodings can be added as requested.
1212

1313
The Fmod file can be read like this
1414
```c#
15+
//Will throw if the bank is not valid.
1516
FmodSoundBank 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+
1824
You can then query some properties about the bank:
1925
```c#
2026
FmodAudioType type = bank.Header.AudioType;
@@ -26,6 +32,8 @@ And get the samples stored inside it:
2632
List<FmodSample> samples = bank.Samples;
2733
int frequency = samples[0].Metadata.Frequency; //E.g. 44100
2834
uint 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

3139
And, 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

7685
It also uses System.Text.Json.

0 commit comments

Comments
 (0)