{"id":16204546,"url":"https://github.com/samboycoding/fmod5sharp","last_synced_at":"2025-03-19T07:31:22.968Z","repository":{"id":41238419,"uuid":"396198044","full_name":"SamboyCoding/Fmod5Sharp","owner":"SamboyCoding","description":"Managed-Only C# Library for Decoding FMOD 5 sound banks (FSB or bank files)","archived":false,"fork":false,"pushed_at":"2023-09-02T17:04:34.000Z","size":877,"stargazers_count":35,"open_issues_count":3,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-13T00:55:44.784Z","etag":null,"topics":["audio","fmod","fsb","fsb5","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamboyCoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-15T03:05:40.000Z","updated_at":"2025-01-09T13:55:33.000Z","dependencies_parsed_at":"2024-10-27T20:23:42.643Z","dependency_job_id":"c938841a-9b11-499c-8c72-3568681ae0df","html_url":"https://github.com/SamboyCoding/Fmod5Sharp","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamboyCoding%2FFmod5Sharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamboyCoding%2FFmod5Sharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamboyCoding%2FFmod5Sharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamboyCoding%2FFmod5Sharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamboyCoding","download_url":"https://codeload.github.com/SamboyCoding/Fmod5Sharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976644,"owners_count":20377695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","fmod","fsb","fsb5","reverse-engineering"],"created_at":"2024-10-10T09:58:34.657Z","updated_at":"2025-03-19T07:31:22.507Z","avatar_url":"https://github.com/SamboyCoding.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fmod5Sharp\n## Managed decoder for FMOD 5 sound banks (FSB files).\n\n[![NuGet](https://img.shields.io/nuget/v/Fmod5Sharp?)](https://www.nuget.org/packages/Fmod5Sharp/)\n\nThis library allows you to read FMOD 5 sound bank files (they start with the characters FSB5) into their contained samples,\nand then export those samples to standard file formats (assuming the contained data format is supported).\n\nSupport for more encodings can be added as requested.\n\n## Usage\n\nThe Fmod file can be read like this\n```c#\n//Will throw if the bank is not valid.\nFmodSoundBank bank = FsbLoader.LoadFsbFromByteArray(rawData);\n```\n\nOr if you don't want it to throw if the file is invalid, you can use\n```c#\nbool success = FsbLoader.TryLoadFsbFromByteArray(rawData, out FmodSoundBank bank);\n```\n\nYou can then query some properties about the bank:\n```c#\nFmodAudioType type = bank.Header.AudioType;\nuint fmodSubVersion = bank.Header.Version; //0 or 1 have been observed\n```\n\nAnd get the samples stored inside it:\n```c#\nList\u003cFmodSample\u003e samples = bank.Samples;\nint frequency = samples[0].Metadata.Frequency; //E.g. 44100\nuint numChannels = samples[0].Metadata.Channels; //2 for stereo, 1 for mono.\n\nstring name = samples[0].Name; //Null if not present in the bank file (which is usually the case).\n```\n\nAnd, you can convert the audio data back to a standard format.\n```c#\nvar success = samples[0].RebuildAsStandardFileFormat(out var dataBytes, out var fileExtension);\n//Assuming success == true, then this file format was supported and you should have some data and an extension (without the leading .).\n//Now you can save dataBytes to an file with the given extension on your disk and play it using your favourite audio player.\n//Or you can use any standard library to convert the byte array to a different format, if you so desire.\n```\n\nYou can also check if a given format type is supported and, if so, what extension it will result in, like so:\n```c#\nbool isSupported = bank.Header.AudioType.IsSupported();\n\n//Null if not supported\nstring? extension = bank.Header.AudioType.FileExtension();\n```\n\nAlternatively, you can consult the table below:\n\n| Format | Supported? | Extension | Notes |\n| :-----: | :--------------: | :---------: | :----------: |\n| PCM8 | ✔️ | wav | |\n| PCM16 | ✔️ | wav | |\n| PCM24 | ❌ | | No games have ever been observed in the wild using this format. |\n| PCM32 | ✔️ | wav | Supported in theory. No games have ever been observed in the wild using this format. |\n| PCMFLOAT | ❌ | | Seen in at least one JRPG. |\n| GCADPCM | ✔️ | wav | Tested with single-channel files. Not tested with stereo, but should work in theory. Seen in Unity games. |\n| IMAADPCM | ✔️ | wav | Seen in Unity games. |\n| VAG | ❌ | | No games have ever been observed in the wild using this format. |\n| HEVAG | ❌ | | Very rarely used - only example I know of is a game for the PS Vita. |\n| XMA | ❌ | | Mostly used on Xbox 360. |\n| MPEG | ❌ | | Used in some older games. |\n| CELT | ❌ | | Used in some older indie games. |\n| AT9 | ❌ | | Native format for PlayStation Audio, including in Unity games. | \n| XWMA | ❌ | | No games have ever been observed in the wild using this format. |\n| VORBIS | ✔️ | ogg | Very commonly used in Unity games. |\n\n# Acknowledgements\n\nThis project uses:\n- [OggVorbisEncoder](https://github.com/SteveLillis/.NET-Ogg-Vorbis-Encoder) to build Ogg Vorbis output streams.\n- [NAudio.Core](https://github.com/naudio/NAudio) to do the same thing but for WAV files.\n- [BitStreams](https://github.com/rubendal/BitStream) for parsing vorbis header data.\n- [IndexRange](https://github.com/bgrainger/IndexRange) to make my life easier when supporting .NET Standard 2.0.\n\nIt also uses System.Text.Json.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamboycoding%2Ffmod5sharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamboycoding%2Ffmod5sharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamboycoding%2Ffmod5sharp/lists"}