any port use /dev/dsp directly?

Gary Kline kline at thought.org
Fri Jan 15 02:42:11 UTC 2010


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 at 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



More information about the freebsd-questions mailing list