Skip to content

Commit

Permalink
Bump to 3.0.0, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
SamboyCoding committed Jul 20, 2022
1 parent 96155ae commit fc80e9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Fmod5Sharp/Fmod5Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Configurations>Release;Debug</Configurations>
<Platforms>x86;x64;AnyCPU</Platforms>
<Version>2.0.2</Version>
<Version>3.0.0</Version>
<PackageId>Fmod5Sharp</PackageId>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/SamboyCoding/Fmod5Sharp.git</RepositoryUrl>
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ Support for more encodings can be added as requested.

The Fmod file can be read like this
```c#
//Will throw if the bank is not valid.
FmodSoundBank bank = FsbLoader.LoadFsbFromByteArray(rawData);
```

Or if you don't want it to throw if the file is invalid, you can use
```c#
bool success = FsbLoader.TryLoadFsbFromByteArray(rawData, out FmodSoundBank bank);
```

You can then query some properties about the bank:
```c#
FmodAudioType type = bank.Header.AudioType;
Expand All @@ -26,6 +32,8 @@ And get the samples stored inside it:
List<FmodSample> samples = bank.Samples;
int frequency = samples[0].Metadata.Frequency; //E.g. 44100
uint numChannels = samples[0].Channels; //2 for stereo, 1 for mono.
string name = samples[0].Name; //Null if not present in the bank file (which is usually the case).
```

And, you can convert the audio data back to a standard format.
Expand Down Expand Up @@ -72,5 +80,6 @@ This project uses:
- [OggVorbisEncoder](https://github.com/SteveLillis/.NET-Ogg-Vorbis-Encoder) to build Ogg Vorbis output streams.
- [NAudio.Core](https://github.com/naudio/NAudio) to do the same thing but for WAV files.
- [BitStreams](https://github.com/rubendal/BitStream) for parsing vorbis header data.
- [IndexRange](https://github.com/bgrainger/IndexRange) to make my life easier when supporting .NET Standard 2.0.

It also uses System.Text.Json.

0 comments on commit fc80e9f

Please sign in to comment.