Hello,
As the title says, I’m encountering an issue where FSBank_Build
is generating banks that have imbalanced volume levels.
The second sound that is passed into an FSBank_Subsound::fileData
array consistently is very quiet on playback, even though channel volume is sure to be 1. Playback is in Chrome/Safari with HTML5 Wasm FMOD 2.02.18. I’ve also swapped the file build order, and the second sound is always the quiet one, so it seems like the files aren’t the issue (standard .wav exported from Logic Pro).
Since building the same files with the FSBank utility app works as expected, I probably have something wrong in my code.
FSBank_Init
is called before building with:
const auto NumCores = std::thread::hardware_concurrency();
FSB_CHECK(
FSBank_Init(
FSBANK_FSBVERSION_FSB5,
FSBANK_INIT_DONTLOADCACHEFILES,
NumCores,
CacheDirectory)
);
And here is my code for building - files
is an std::vector<void *>
holding the buffers, and fileSizes
is an std::vector<unsigned>
with the corresponding byte sizes of each.
// Prepare subsound
auto subsound = FSBANK_SUBSOUND();
std::memset(&subsound, 0, sizeof(FSBANK_SUBSOUND));
subsound.desiredSampleRate = samplerate;
subsound.numFiles = files.size();
subsound.fileData = files.data();
subsound.fileDataLengths = fileSizes.data();
// Build
FSB_CHECK( FSBank_Build(&subsound, 1, BankFormat,
FSBANK_BUILD_DEFAULT, 75, nullptr, nullptr) );
FMOD version is 2.02.18
System: M1 Mac OS Sonoma
(It appears that libfsbvorbis and libopus for this version are only available for the x86_64 platform so I am building to FADPCM format.)
Thanks in advance for any insight, I have no idea what might be causing this.