From owner-freebsd-multimedia Tue Mar 17 12:57:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA27235 for freebsd-multimedia-outgoing; Tue, 17 Mar 1998 12:26:29 -0800 (PST) (envelope-from owner-freebsd-multimedia@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA27069 for ; Tue, 17 Mar 1998 12:25:52 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id TAA22476; Tue, 17 Mar 1998 19:58:34 +0100 From: Luigi Rizzo Message-Id: <199803171858.TAA22476@labinfo.iet.unipi.it> Subject: Re: Flushing audio capture buffer To: graphix@toybox.cc.iastate.edu (Kent Vander Velden) Date: Tue, 17 Mar 1998 19:58:33 +0100 (MET) Cc: freebsd-multimedia@FreeBSD.ORG In-Reply-To: <199803171642.KAA07216@toybox.cc.iastate.edu> from "Kent Vander Velden" at Mar 17, 98 10:42:00 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I would like to flush the capture buffer of the sound card. I want to do > this inorder to have my program stay in sync with the data being captured. ... > time required by the program for each read buffer is greater than how long > before the capture buffer is full again. My program does not have to receive > all of the caputured data but it must stay in sync so I am willing to lose > some of the data. So what I thought I would do is flush the capture buffer > before each read. Can the capture buffer be flushed? i suppose you want to flush it _after_ a read() of useful data. and yes, it can be flushed using read() and either non blocking mode, or calling FIONREAD before the read to see how much data is queued. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message