I am using FMOD to play some sounds from files and I add some effects. I want to preview the effects added to it, and save the satisfied result to disk. I have tried using SetOutput and Init and then createSound, playSound but I cannot hear the sound and the file saved in the disk seems wrong!
If I don't use setOutput and init system with the 4th parameter 0, I can hear the sound.
appending my code :
result = FMOD_System_SetOutput(gSystem,FMOD_OUTPUTTYPE_WAVWRITER);
result = FMOD_System_Init(gSystem, 32,FMOD_INIT_NORMAL,"/sdcard/wav.wav");
result = FMOD_System_CreateSound(gSystem, filename, FMOD_SOFTWARE | FMOD_LOOP_NORMAL, 0, &gSound);
result = FMOD_System_PlaySound(gSystem, FMOD_CHANNEL_FREE, gSound, 0, &gChannel);
Hope you can help me!
Thank you
If you use setOutput with WavWriter the audio will go to a file instead of the speakers. If this isn't what you are looking for perhaps you should try capturing the audio with a custom DSP.
The basic idea is you follow the dsp_custom example, make a user created DSP, then in the DSP read callback write the data out to disk. You must also copy the data coming into the DSP into the output buffer (direct memcpy) to allow the audio to pass through to the speakers. You can place the DSP anywhere in the DSP network you want to capture audio. If you are only interested in the final mix, just use System::addDSP.