[alsa-devel] Create a stereo sound with alsa
clemens at ladisch.de
Sat Jul 28 11:36:08 CEST 2012
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;
The device expects 16-bit samples, but you write 8-bit values.
More information about the Alsa-devel