Fmod5Sharp 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Fmod5Sharp --version 1.0.1                
NuGet\Install-Package Fmod5Sharp -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fmod5Sharp" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fmod5Sharp --version 1.0.1                
#r "nuget: Fmod5Sharp, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Fmod5Sharp as a Cake Addin
#addin nuget:?package=Fmod5Sharp&version=1.0.1

// Install Fmod5Sharp as a Cake Tool
#tool nuget:?package=Fmod5Sharp&version=1.0.1                

Fmod5Sharp

Managed decoder for FMOD 5 sound banks (FSB files).

NuGet

This library allows you to read FMOD 5 sound bank files (they start with the characters FSB5) into their contained samples, and then export those samples to ogg files (assuming the contained data is vorbis-encoded).

Support for more encodings can be added as requested.

Notice (Additional Dependencies)

In order to restore ogg files from the Fmod sample data, this library uses libopus and libvorbis. These are not provided, and must be installed separately or shipped with your application. If on windows, they should be named opus.dll and vorbis.dll. On other platforms, installing libopus or libvorbis should be sufficient, but I haven't tested this.

Regardless, the architecture of the native assemblies must match that of your application, or you will get a BadImageFormatException thrown by the system.

Usage

The Fmod file can be read like this

FmodSoundBank bank = FsbLoader.LoadFsbFromByteArray(rawData);

You can then query some properties about the bank:

FmodAudioType type = bank.Header.AudioType;
uint fmodSubVersion = bank.Header.Version; //0 or 1 have been observed

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.

And, you can convert the audio data back to a standard format. For example if bank.Header.AudioType == FmodAudioType.VORBIS:

var oggFileBytes = FmodVorbisRebuilder.RebuildOggFile(samples[0]);
//Now you can save oggFileBytes to an .ogg file on your disk and play it using your favourite audio player.
//Or you can use any standard library to convert the byte array to a different format, if you so desire.

If the user's system does not have libopus or libvorbis, this will throw a DllNotFoundException.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Fmod5Sharp:

Repository Stars
AssetRipper/AssetRipper
GUI Application to work with engine assets, asset bundles, and serialized files
nesrak1/UABEA
c# uabe for newer versions of unity
Version Downloads Last updated
3.0.1 31,134 7/22/2022
3.0.0 648 7/20/2022
2.0.2 496 7/19/2022
2.0.1 834 7/4/2022
2.0.0 439 7/4/2022
1.2.0 8,789 9/20/2021
1.1.1 370 9/19/2021
1.1.0 357 9/19/2021
1.0.1 680 8/15/2021
1.0.0 353 8/15/2021