28 Jul
2012
28 Jul
'12
11:36 a.m.
Luca Longhi wrote:
Hi. I've written a code to play two different sine wave (same amplitude and f1=440Hz f2=600Hz) one on the left channel and the other on the right channel. It seems to be working. I've tried doing the same thing using two different sounds file (stereo) but the result is wrong.
err=snd_pcm_hw_params_set_format(handle, params, SND_PCM_FORMAT_S16_LE); //16bit per campione=2byte per campione ... char * buffer1; char * buffer2; char * risultato; ... {v1=buffer1[j1];} {v2=buffer2[j2];} risultato[i++]=v1; risultato[i++]=v2;
The device expects 16-bit samples, but you write 8-bit values.
Regards, Clemens