0
0

Hello,
I would like to
1. mix 2 mono data buffers into one buffer for stereo and play it.
2. Then save the stereo buffer to file.
3. And be able to read the file back in to play it.

Could you please provide sample code for doing this; especially the first step.
Thanks

  • You must to post comments
0
0

Or just download/install a freebie app like Audacity. Open the mono wav file, add a 2nd layer and duplicate the Mono layer to create a stereo wav file. I’m sure depending on the size of the wav file it would take fewer resources to run in FMOD.

  • You must to post comments
0
0

Yeah, FMOD is an engine primarily geared toward sound playback. We don’t really provide out of the box support for what you want, it is possible but it would be quite involved. and you would have to do the majority of the work yourself, you could use FMOD to decode the sounds.

  • You must to post comments
0
0

I need to "Open the mono wav file" programatically. I need an API for Audacity. Any suggestions?

  • You must to post comments
0
0

I am mixing raw PCM data. I was following the example [url]http://52.88.2.202/forum/viewtopic.php?t=11598&highlight=mix

[code:j28svagn]FMOD_RESULT F_CALLBACK pcmreadcallback(FMOD_SOUND *sound, void *data, unsigned int datalen)
{
unsigned int count;
static float t1 = 0, t2 = 0; // time
static float v1 = 0, v2 = 0; // velocity
signed short *stereo16bitbuffer = (signed short *)data;

for (count=0; count < datalen>>2; ++count)        // >>2 = 16bit stereo (4 bytes per sample) 
{ 
    *stereo16bitbuffer++ = (signed short)(sin(t1) * 32767.0f);    // left channel 
    *stereo16bitbuffer++ = (signed short)(sin(t2) * 32767.0f);    // right channel 

    t1 += 0.06f + v1; 
    t2 += 0.06f + v2; 
    v1 += (float)(sin(t1) * 0.002f); 
    v2 += (float)(sin(t2) * 0.002f); 
} 

return FMOD_OK; 

}

[/code:j28svagn]

Is this a path I could take?[/url]

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.