0
0

Hi all,

I’m new to FMOD, and I’ve been tasked with trying to implement simple events over the next couple of weeks with our indie team to see if we can integrate the designer into a workflow for myself and future sound designers and composers.

I figured I might as well start with the examples, but when running the script, the "example" executable fails building the first sound bank:

[code:anruca5u]:media user$ ./build_media_files.sh
Building tutorial_bank.fsb...
Build Error!
Error: Invalid preferences for sub-sound index 26. — "System"
cp: *.fsb: No such file or directory[/code:anruca5u]

I checked the value, and it’s tossing up FSBANK_ERR_INVALID_PARAM.

Here’s the buildBank function in the copy I downloaded (latest)

[code:anruca5u]FSBANK_RESULT buildBank(const char **fileNames, unsigned int numFileNames, const char *outputFileName)
{
FSBANK_RESULT result = FSBANK_OK;
FSBANK_SUBSOUND *subSounds = (FSBANK_SUBSOUND *)alloca(numFileNames * sizeof(FSBANK_SUBSOUND));

for (unsigned int i = 0; i < numFileNames; i++)
{
    subSounds[i].fileNames          = &fileNames[i];
    subSounds[i].numFileNames       = 1;
    subSounds[i].modeFlags          = FSBANK_MODE_DEFAULT; 
    subSounds[i].overrideFlags      = FSBANK_BUILD_DEFAULT;
    subSounds[i].overrideQuality    = 0;
    subSounds[i].desiredSampleRate  = 0;
}

printf("Building %s...\n", outputFileName);

result = FSBank_Build(subSounds, numFileNames, FSBANK_FORMAT_MP3, FSBANK_BUILD_DEFAULT | FSBANK_BUILD_DONTLOOP, 0, NULL, outputFileName);
if (result != FSBANK_OK)
{
printf("FSBANK_RESULT is %i\n", result); //added by me
    printErrors(subSounds);
    return result;
}

printf("done.\n");
return FSBANK_OK;

}[/code:anruca5u]

And here’s the line that calls it:
[code:anruca5u] result = buildBank(gTutorialFileNames, gNumTutorialFileNames, "tutorial_bank.fsb");[/code:anruca5u]

Index 26 appears to be music/layer-guitar-alt-c.ogg, but I can’t see what would make that need different parameters than the others. Any ideas on how to get this running?

Thanks in advance!

  • You must to post comments
0
0

Looks like a bit of naughty coding on our part, the FSBANK_SUBSOUND struct has a new member in it now (percentOptimizedRate). The idea was people should memset their structs to avoid problems like this but we don’t appear to be taking our own advise :p

I’ll get this fixed up for the next release. For now I would suggest you memset each sub sound struct in the for loop before assigning the values to it to be safe.

  • You must to post comments
0
0

Thanks for getting back to me so quickly, memsetting the structs to 0 did the trick. :)

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.