3 Apr
2007
3 Apr
'07
6:29 p.m.
Hi Gordon,
Gordon Miller schrieb:
I went for this :
/*******************************************************/ void record_block (void *buffer) { int rc, needed = MAX_LEN; void *buf_ptr = buffer;
do { rc = snd_pcm_readi (handle, buf_ptr, needed); needed -= rc; buf_ptr += rc * (stereo_channel ? BPSSTEREO : BPSMONO); } while (needed);
} /* end record_block */ /****************************************************/
You could also use: if (rc > 0) { needed -= rc; buf_ptr += snd_pcm_frames_to_bytes( handle, rc ); }
Gregor