Hello there!
My goal is to be able to open any of the various audio formats with FMOD, and export raw PCM data at a sample rate of 48 kHz.
It seems I can do mostly that, but I can’t seem to figure out how to resample the audio to be 48 kHz.
unsigned int length = 0;
unsigned int read = 0;
pSound->getLength( &length, FMOD_TIMEUNIT_PCMBYTES );
unsigned char *buf = new unsigned char[ length ];
pSound->readData( buf, length, &read );
std::ofstream file;
file.open( "test.raw", std::ofstream::binary );
file.write( ( const char *)buf, length );
file.close();
That’s pretty much it, it’s just a requirement that the output is 48 kHz. Is there any way to do that?