# FSB5 file format specification?

**URL:** <https://qa.fmod.com/t/fsb5-file-format-specification/12511>\
**Category:** FMOD Engine\
**Created:** [May 31, 2016, 3:26pm UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511 "2016-05-31T15:26:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BearishSun](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@BearishSun](https://qa.fmod.com/u/BearishSun)\
**Post date:** [May 31, 2016, 3:26pm UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511/1 "2016-05-31T15:26:17Z")

</div>

Hi, is there any information about how FSB5 file structure looks like? I found this, which describes every format up to FSB4: [https://www.fmod.org/questions/question/forum-4928/](https://www.fmod.org/questions/question/forum-4928/). I would like something similar for FSB5.

I’m trying to manually create FSB files in-memory during runtime, so I can load Ogg Vorbis using the FMOD\_CREATECOMPRESSEDSAMPLE flag (since it only supports it in FSB format). I don’t want to use FSBank API because it will recompress the data, but I already have the compressed vorbis data and performing compression during runtime is not an option. I just need to (hopefully) append the FSB header to it.

Any help on FSB5 format, or how to do what I’m trying to in some other way, is appreciated.

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [May 31, 2016, 9:49pm UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511/2 "2016-05-31T21:49:39Z")

</div>

We don’t have any public information about the FSB5 file format and it’s quite a bit more complicated than FSB4 (not simply a header struct).

Also the problem you face is not as simple as you might think. FSB Vorbis is not Ogg Vorbis packed with an FSB header. We strip away the Ogg layer, use our own packet headers and simplify some of the compression options on the encode side to ensure efficient decoding. The only way to produce compatible Vorbis bitstream is to use our tools or libraries.

If you don’t have the source assets to compress from your only option is recompress and audition the result. Depending on the level of compression of the original Ogg Vorbis you may not lose much quality.

---

<div class="post-metadata">

**Author:** ![BearishSun](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@BearishSun](https://qa.fmod.com/u/BearishSun)\
**Post date:** [May 31, 2016, 9:59pm UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511/3 "2016-05-31T21:59:37Z")

</div>

> [@](#):
>
> We don’t have any public information about the FSB5 file format and it’s quite a bit more complicated than FSB4 (not simply a header struct).
> 
> Also the problem you face is not as simple as you might think. FSB Vorbis is not Ogg Vorbis packed with an FSB header. We strip away the Ogg layer, use our own packet headers and simplify some of the compression options on the encode side to ensure efficient decoding. The only way to produce compatible Vorbis bitstream is to use our tools or libraries.
> 
> If you don’t have the source assets to compress from your only option is recompress and audition the result. Depending on the level of compression of the original Ogg Vorbis you may not lose much quality.

Thanks for the answer, I was afraid of that. We’re using multiple audio backends and I was hoping we can keep the compressed data in common Ogg Vorbis format for all of them.

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [May 31, 2016, 10:30pm UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511/4 "2016-05-31T22:30:09Z")

</div>

That is possible, but you’d need to stick to FMOD\_CREATESOUND and FMOD\_CREATESTREAM as you’ve discovered FMOD\_CREATECOMPRESSEDSAMPLE is not available for our Ogg Vorbis decoder.

The only other option that comes to mind is use MP3, it’s not as good as Vorbis but we do support is as FMOD\_CREATECOMPRESSEDSAMPLE for now.

---

<div class="post-metadata">

**Author:** ![BearishSun](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@BearishSun](https://qa.fmod.com/u/BearishSun)\
**Post date:** [June 1, 2016, 9:17am UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511/5 "2016-06-01T09:17:42Z")

</div>

We would like to offer all three possibilities for all audio clips.

I’ll try manually decompressing Ogg to PCM and using FMOD\_OPENUSER to get around the issue, if that’s possible.

---

<div class="post-metadata">

**Author:** ![BearishSun](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@BearishSun](https://qa.fmod.com/u/BearishSun)\
**Post date:** [June 1, 2016, 12:22pm UTC](https://qa.fmod.com/t/fsb5-file-format-specification/12511/6 "2016-06-01T12:22:26Z")

</div>

Adding this for those that might be facing a similar problem.

Although I wasn’t able to create FSB files in memory, I was able to decompress Ogg Vorbis during playback manually. To do it you should create your sound using FMOD\_OPENUSER and in the read callback manually decompress Ogg into PCM, which should achieve the same effect as FMOD\_CREATECOMPRESSEDSAMPLE.
