Re: /dev/dsp, and /dev/audio

Hannu Savolainen (hannu@4front-tech.com)
Tue, 15 Jul 1997 10:14:06 +0300 (EET DST)


On Sun, 13 Jul 1997, Michael Ballbach wrote:

> I'm trying to determine the format of the sound data returned by
> /dev/audio and /dev/dsp. How is this data encoded? I know /dev/audio
> returns data as though it were an au, but how is that encoded? Is one byte
> frequency, and one byte amplitude? I'm especially interested in /dev/dsp's
> format. Thanks for any response. :)
Each "sample" returned by /dev/dsp and /dev/audio represent amplitude of
the input signal at given moment. When using the default sampling rate of
the device (8000 Hz) there is one sample for every 1/8000th of second.

By default each byte returned by /dev/dsp contains amplitude of one sample
in 8 bit unsigned format (unsigned char). Value of 0x00 is the minimum and
0xff is the maximum.

/dev/audio returns samples using mu-Law format which is something you
don't want to know about.

Btw, programming information for /dev/dsp is available at
http://www.4front-tech.com/pguide.

Best regards,

Hannu
-----
Hannu Savolainen (hannu@voxware.pp.fi, hannu@4front-tech.com)
http://www.4Front-Tech.com/oss.html (Open Sound System (OSS))
http://personal.eunet.fi/pp/voxware (OSS Free/TASD/VoxWare)