From owner-freebsd-questions@FreeBSD.ORG Fri Jan 15 02:42:11 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFA851065693 for ; Fri, 15 Jan 2010 02:42:11 +0000 (UTC) (envelope-from kline@thought.org) Received: from ethic.thought.org (plato.thought.org [209.180.213.209]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1B08FC2A for ; Fri, 15 Jan 2010 02:42:10 +0000 (UTC) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by ethic.thought.org (8.14.3/8.14.3) with ESMTP id o0F2fuFC048625; Thu, 14 Jan 2010 18:41:57 -0800 (PST) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Thu, 14 Jan 2010 18:41:57 -0800 (PST) Date: Thu, 14 Jan 2010 18:41:56 -0800 From: Gary Kline To: Dan Nelson Message-ID: <20100115024156.GA28725@thought.org> References: <20100114012059.GA3921@thought.org> <20100114013746.GB67999@orion.hsd1.pa.comcast.net> <20100114024242.GA9744@thought.org> <20100114165717.GA5651@dan.emsphone.com> <20100114201616.GA73961@thought.org> <20100114211947.GB5651@dan.emsphone.com> <20100114223105.GA84284@thought.org> <20100114230825.GD5651@dan.emsphone.com> <20100115001351.GA27272@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100115001351.GA27272@thought.org> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 23 years of service to the Unix community. X-Spam-Status: No, score=-1.2 required=3.6 tests=ALL_TRUSTED,BAYES_00, FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ethic.thought.org Cc: freebsd-questions@freebsd.org Subject: Re: any port use /dev/dsp directly? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 02:42:11 -0000 On Thu, Jan 14, 2010 at 04:13:51PM -0800, Gary Kline wrote: > On Thu, Jan 14, 2010 at 05:08:25PM -0600, Dan Nelson wrote: > > In the last episode (Jan 14), Gary Kline said: > > > On Thu, Jan 14, 2010 at 03:19:47PM -0600, Dan Nelson wrote: > > > > The sox port comes with its own "play" command that can parse many > > > > containers and encodings, including wav files. > > > > > > I did see that. I'm wondering of theses is some sox translation that > > > would do say > > > > > > %sox -w WAV -r [rawoutfile] > > > > Certainly; file conversion is one of the basic purposes of sox. Something > > like: > > > > sox myfile.wav -b 16 -e signed -r 22050 -c 2 myfile.raw > > > > will convert the wav file (whatever its format is) to a signed 16-bit stereo > > raw file. For raw files, you can also use special file extensions that > > specify the encoding ("myfile.s16" for example, for a signed 16-bit file). > > Adding "-V3" to the beginning of the command will print the full input and > > output specs, plus the filter chain required to do the conversion (if any). > > The sox and soxformat manpages are pretty comprehensive. Well, what I mentioned earlier about the similarities of the pcaudio.c code and my test code gave me the clue: In the read() and write(), the number of bytes read in before the read failed was the right number, len, to be written. In my test code I reused my code from 1996. Then my "sizeof buf" was valid because it was a simple sine wave. This time I was using a different array. .... gary > > -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 7.79a release of Jottings: http://jottings.thought.org/index.php