Im writting a program that makes DSP OScillator sounds (sin, square, saw, triangle and noise). I have to play one sound on right ear and one on left, each one with his own properties like frequency and volume. I wrote object orientation code for encapsulate properties and access to the mixer. LeftObject is for Left speaker (ear) and Right for right.. I use setSpeakerMix(1,0,0,0,0,0,0) for Left and setSpeakerMix(0,1,0,0,0,0,0) for right. I plot an oscilloscope with the 2 signals and all is fine. The graph is acording the properties of the signal and looks fine. But when i connect speaker lef-right output to a real oscilloscope the 2 signals look defased, sometimes fased and in a few seconds they defased again. I need to control it and i try to decrement latency or granularity with System_setDSPBufferSize but i dont understand the function. My question is how can i control the signals to begin at the same time and to avoid defase of one of them????
- xbirkenau asked 11 years ago
I just use :
Result := FMOD_System_PlayDSP(fsystem, FMOD_CHANNEL_REUSE,fDSP, True, fChannel);
Result := FMOD_Channel_setSpeakerMix(1,0,0,0,0,0,0) //For LEft.
Result := FMOD_Channel_SetVolume(100);
Result := FMOD_Channel_setFrequency(44100);
Result := FMOD_DSP_SetParameter(fDsp, FMOD_OSCILLATOR, rate);
Result := FMOD_DSP_SetParameter(fDSP, 0, SIN_WAVE);
Result := FMOD_Channel_setPaused(fChannel,FALSE);
This code is encapsulated in a class named Control. I have one control for Left and One For right speakers. If i reduce latency or granularity my output will be more consistent????
Please login first to submit.