# FSBank Conversion of wav to fsb5 problem

**URL:** <https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803>\
**Category:** FMOD Engine\
**Created:** [May 26, 2022, 5:15am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803 "2022-05-26T05:15:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [May 26, 2022, 5:15am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/1 "2022-05-26T05:15:49Z")

</div>

I dont know how the FSBank API works  
i have everything integrated already  
i just want to know how i can convert a wav to fsb5

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 27, 2022, 2:11am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/2 "2022-05-27T02:11:48Z")

</div>

Open the “bin” folder in your FMOD Studio API installation folder and open the `fsbank.exe` file. Use this program to add the audio files you need and then click “Build” to build an `.fsb` file.

---

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [May 27, 2022, 5:11am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/3 "2022-05-27T05:11:51Z")

</div>

i can do that as well but i was writing my own way to do that so that i can wrap your code with C# and use it in Unity3d  
Here is my progress so far

```auto
#include <FSB/fsbank.h>
#include <FSB/fsbank_errors.h>
#include <stdio.h>
#include <string>
using namespace std;

extern "C" _declspec(dllexport) void createSubsound();

void createSubsound()
{
	const char* cache = "G:/cache";
	FSBank_Init(FSBANK_FSBVERSION_FSB5, FSBANK_INIT_NORMAL, (unsigned int)2, cache);
	FSBANK_SUBSOUND subsound;
	const char* const msg = "G:/u.wav";
	subsound.fileNames = &msg;
	subsound.overrideFlags = FSBANK_BUILD_DISABLESYNCPOINTS;
	subsound.overrideQuality = 1;
	subsound.desiredSampleRate = 1;
	const FSBANK_SUBSOUND* newSubsound = &subsound;

	FSBank_Build(newSubsound, 1, FSBANK_FORMAT_VORBIS, FSBANK_BUILD_DEFAULT | FSBANK_BUILD_DONTLOOP, 100, NULL, "G:/test.fsb5");
}

```

But for some reason it doesnt seem to work

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 31, 2022, 4:57am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/6 "2022-05-31T04:57:31Z")

</div>

I consulted with our lead dev who mentions the following:

- `FSBANK_SUBSOUND subsound` isn’t zero initialized so that will cause issues.
- `subsound.numFiles` isn’t specified, it should be 1 for your case.
- Set the `desiredSampleRate` to `0` for default.

Please make these changes and let me know if you’re still having issues.

---

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [June 1, 2022, 4:02am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/8 "2022-06-01T04:02:32Z")

</div>

I tried your way of solving it  
i also initialized the FSBank by replacing the library with the latest one

but still on build it doesnt work  
Like it says everything worked fine but there is no output

```
getchar();
FSBANK_RESULT result = FSBank_Init(FSBANK_FSBVERSION_FSB5, FSBANK_INIT_NORMAL, 2, "G:/cache");
cout << "FSBank Initialized" << endl;
cout << "FSBank API Result:- ";
std::cout << FSBank_Result_ToString(result) << std::endl;

FSBANK_SUBSOUND subsound = { NULL };
cout << "Subsound initialized zero/NULL" << endl;
const char* const msg = "G:/u.wav";
subsound.fileNames = &msg;
subsound.overrideFlags = FSBANK_BUILD_DISABLESYNCPOINTS;
subsound.overrideQuality = 1;
subsound.desiredSampleRate = 0;
subsound.numFiles = 1;
const FSBANK_SUBSOUND* newSubsound = &subsound;
cout << "subsound values assigned" << endl;

result = FSBank_Build(newSubsound, 1, FSBANK_FORMAT_VORBIS, FSBANK_BUILD_DEFAULT | FSBANK_BUILD_DONTLOOP, 100, NULL, "G:/Special.fsb5");
cout << "building........." << endl;
cout << "FSBank API Result for build:- ";
std::cout << FSBank_Result_ToString(result) << std::endl;

```

}

the code should be working fine but there is an error i am facing whenever i try to run the build

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/af07d53611acfcf372822d882beef489250d17d2.png)

if you know where I am mistaken then guide would be appreciated

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [June 1, 2022, 7:18am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/9 "2022-06-01T07:18:31Z")

</div>

That error means you are missing the dll required for building to the requested format, in this case Vorbis.  
To solve this, you will need to copy the Vorbis dll from “ **api\fsbank\lib\x64\libfsbvorbis64.dll** ” into your executable directory.

---

<div class="post-metadata">

**Author:** ![CreatorsStudio](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/creatorsstudio/32/3590_2.png) [@CreatorsStudio](https://qa.fmod.com/u/CreatorsStudio)\
**Post date:** [June 1, 2022, 8:42am UTC](https://qa.fmod.com/t/fsbank-conversion-of-wav-to-fsb5-problem/18803/10 "2022-06-01T08:42:09Z")

</div>

thanks  
it worked  
thanks a lot
