generate sound with PCM

(Jake Araujo-Simon) #1

If I have the time-amplitude waveform of a sound, which I understand is just PCM data, can FMOD transform this into a sound object for playback?


(Nicholas Wilcox) #2

Yes it can. You can pass a pointer to your PCM data instead of a string filename.

You’ll need some extra code along the lines of

soundinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
// fill out frequency, channel count, PCM format, length in soundinfo
FMOD::Sound* sound;
system->createSound(pointerToPcmData, FMOD_OPENMEMORY_POINT | FMOD_OPENRAW, &soundinfo, &sound);

(Nicholas Wilcox) #3

Edited to fix missing element of code