2011-03-30 13:49:47 +00:00
|
|
|
.TH AUDIO 3
|
|
|
|
.SH NAME
|
2011-08-26 03:45:30 +00:00
|
|
|
audio \- audio device
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B bind -a #A /dev
|
|
|
|
.sp 0.3v
|
|
|
|
.B /dev/audio
|
2011-11-01 23:17:51 +00:00
|
|
|
.B /dev/audioctl
|
|
|
|
.B /dev/audiostat
|
2011-03-30 13:49:47 +00:00
|
|
|
.B /dev/volume
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The audio device serves a one-level directory,
|
|
|
|
giving access to the stereo audio ports.
|
|
|
|
.B Audio
|
2011-08-26 03:45:30 +00:00
|
|
|
is the data file, which can be written for audio playback.
|
2011-03-30 13:49:47 +00:00
|
|
|
Audio data is a sequence of stereo samples, left sample first.
|
|
|
|
Each sample is a 16 bit little-endian two's complement integer;
|
|
|
|
the default sampling rate is 44.1 kHz.
|
|
|
|
.PP
|
|
|
|
The length of the
|
|
|
|
.B audio
|
|
|
|
file as returned by
|
|
|
|
.IR stat (2)
|
2011-11-01 23:17:51 +00:00
|
|
|
represents the number of bytes buffered for output.
|
|
|
|
.PP
|
|
|
|
.B Audioctl
|
|
|
|
is driver specific control file and left undocumented here.
|
|
|
|
.PP
|
|
|
|
.B Audiostat
|
|
|
|
is a read only status file. The first line has a length of 32 bytes
|
|
|
|
including the newline and starts with the string
|
|
|
|
.B bufsize
|
2013-12-26 21:07:01 +00:00
|
|
|
followed by the preferred write unit (in bytes) and the string
|
2011-11-01 23:17:51 +00:00
|
|
|
.B buffered
|
|
|
|
followed by the number of bytes currently queued for output. The
|
|
|
|
numbers are decimal and right-padded with spaces to fit.
|
|
|
|
After this fixed header, the contents of the file is driver specific.
|
2011-03-30 13:49:47 +00:00
|
|
|
.PP
|
|
|
|
.B Volume
|
2011-11-01 23:17:51 +00:00
|
|
|
is the control file associated with the audio port. Each source has
|
|
|
|
an associated stereo volume control,
|
|
|
|
ranging from 0 (quiet) to 100 (loud).
|
|
|
|
In addition, there are controls for the sampling rate,
|
2011-08-26 03:45:30 +00:00
|
|
|
latency control and for any tone controls.
|
2011-03-30 13:49:47 +00:00
|
|
|
Reads
|
|
|
|
return lines of the form
|
|
|
|
.IP
|
|
|
|
.I source
|
2011-11-01 23:17:51 +00:00
|
|
|
.I left
|
|
|
|
.I right
|
|
|
|
.PP
|
|
|
|
or
|
|
|
|
.IP
|
|
|
|
.I source
|
2011-03-30 13:49:47 +00:00
|
|
|
.I value
|
|
|
|
.PP
|
|
|
|
Valid sources depend on the particular audio device,
|
|
|
|
though all devices have an
|
|
|
|
.B audio
|
2011-11-01 23:17:51 +00:00
|
|
|
stereo source, which controls the output volume from the D/A converter.
|
|
|
|
Values for
|
|
|
|
.B speed
|
|
|
|
set the sampling frequency of the audio device and
|
|
|
|
.B delay
|
|
|
|
limits the audio data output buffering to a number of samples.
|
2011-03-30 13:49:47 +00:00
|
|
|
.PP
|
2011-11-01 23:17:51 +00:00
|
|
|
Writes accept the same format except that for stereo sources
|
|
|
|
.I left
|
|
|
|
and
|
|
|
|
.I right
|
|
|
|
can be abbreviated to a single
|
|
|
|
.I value
|
|
|
|
if both should be set the same.
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/9/port/devaudio.c
|
|
|
|
.SH SEE ALSO
|
2011-08-26 03:24:55 +00:00
|
|
|
.IR nusb (4)
|