[Alsa-user] Playing audio with ALSA api(newbie)

2012-04-11 Thread Fabio Gonzalez
I'm new to ALSA. I made a program that plays a file, pure sound. The problem is that every time I write, apparently repeats a part of the previous sound. I know that the program gives segmentation fault, that the moment is not a problem. This occurs after the song finishes playing. I send the sourc

Re: [Alsa-user] Playing audio with ALSA api(newbie)

2012-04-11 Thread Torsten Schenk
Hello Fabio, > snd_pcm_writei (playback_handle, p, 131072) writes 131072 FRAMES > p += 131072 increases the pointer by 131072 SAMPLES. If you write p += 131072 * number_of_channels instead, your program should do the job. Greets, Torsten ---