10 Apr
2008
10 Apr
'08
8:41 a.m.
Rong-Jhe wrote:
buffer size = 9408 frames
A sample in 16-bit, two channels is 4 bytes. I allocate a audio data of 9408x4=37632 bytes.
audio_data=malloc(buffer_size*4);
This audio_data buffer will receive audio data from the network. If this buffer is full, I use snd_pcm_writei( ) to put the buffer into the pcm.
When this buffer is full, the device buffer is completely empty, and even the slightest delay will result in an underrun.
Write data to the device buffer immediately when you receive it.
HTH Clemens