# using C++ code for importing files into the sound bank

**URL:** <https://qa.fmod.com/t/using-c-code-for-importing-files-into-the-sound-bank/12620>\
**Category:** FMOD Studio\
**Created:** [July 28, 2016, 3:48pm UTC](https://qa.fmod.com/t/using-c-code-for-importing-files-into-the-sound-bank/12620 "2016-07-28T15:48:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![golghp](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@golghp](https://qa.fmod.com/u/golghp)\
**Post date:** [July 28, 2016, 3:48pm UTC](https://qa.fmod.com/t/using-c-code-for-importing-files-into-the-sound-bank/12620/1 "2016-07-28T15:48:14Z")

</div>

Hi all,

I’m currently working on a project and we are using FMOD as the sound API. We decided to always have compressed formats of the audio file. I’ll write the code in a way that whenever the user provides a file path, the extension of the sound file will be checked, if it’s already compressed there will be no changes but if it’s in the .wav of any other uncompressed file, we will convert the file format to Vorbis or mp3.  
As using the encoder codes directly in the code seems to be complicated (I tried to use Vorbis encoder download from [Xiph.org](http://Xiph.org) and it seems that a lot of parameters need to be set for which I have no idea), I guess using the FMOD sound bank in the best choice.  
However I need to know how I can import files to the sound bank and then load the desired format using C++ coding. I know that it’s possible to do that using the FMOD sound bank generator exe tool, but I need to add a piece of code in my project to do that automatically at run time (whenever an uncompressed sound file is obtained from the user).  
Any help would be really 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:** [July 28, 2016, 11:49pm UTC](https://qa.fmod.com/t/using-c-code-for-importing-files-into-the-sound-bank/12620/2 "2016-07-28T23:49:46Z")

</div>

To encode to FSB from C++ you’ll need to make use of the FSBank API, check out the [documentation](http://www.fmod.org/documentation/#content/generated/fsbank_api_functions.html) for details.

---

<div class="post-metadata">

**Author:** ![golghp](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@golghp](https://qa.fmod.com/u/golghp)\
**Post date:** [July 29, 2016, 2:25pm UTC](https://qa.fmod.com/t/using-c-code-for-importing-files-into-the-sound-bank/12620/3 "2016-07-29T14:25:09Z")

</div>

> [@](#):
>
> To encode to FSB from C++ you’ll need to make use of the FSBank API, check out the [documentation](http://www.fmod.org/documentation/#content/generated/fsbank_api_functions.html) for details.

Thank you so much Mathew.

---

<div class="post-metadata">

**Author:** ![golghp](https://avatars.discourse-cdn.com/v4/letter/g/90ced4/32.png) [@golghp](https://qa.fmod.com/u/golghp)\
**Post date:** [July 29, 2016, 2:25pm UTC](https://qa.fmod.com/t/using-c-code-for-importing-files-into-the-sound-bank/12620/4 "2016-07-29T14:25:14Z")

</div>

Thank you so much Mathew.
