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 _______________________________________________ Alsa-devel mailing list Alsa-devel@xxxxxxxxxxxxxxxx http://mailman.alsa-project.org/mailman/listinfo/alsa-devel