I’ve identified the error here and have been able to fix it.
I misunderstood the documentation of FSBANK_SUBSOUND – Specifically, “fileNames - List of file names used to produce an interleaved sound.”.
I assumed this was where I was to provide the paths to all of my waves that I wanted to build into the .fsb, but the correct way to do it is to have an FSBANK_SUBSOUND for each sub sound (should be obvious, right? My mistake…)
My updated, correct code:
std::vector<FSBANK_SUBSOUND> subSounds;
std::vector<std::vector<const char *>>
subSoundFileNames; // Need to keep strings in scope...
for (const auto &fileName : wavFileNames)
{
subSoundFileNames.push_back({fileName.c_str()});
FSBANK_SUBSOUND subSound = {0};
subSound.fileNames = subSoundFileNames.back().data();
subSound.numFiles = 1;
subSounds.push_back(subSound);
}
ERRCHECK(FSBank_Build(subSounds.data(), static_cast<unsigned int>(subSounds.size()),
FSBANK_FORMAT_PCM, FSBANK_BUILD_DEFAULT, 0, nullptr, outputPath);
This actually builds a set of wavs into a single .fsb, which was my intention.