]> git.lizzy.rs Git - plan9front.git/blob - sys/man/3/audio
arch(3): document msr
[plan9front.git] / sys / man / 3 / audio
1 .TH AUDIO 3 
2 .SH NAME
3 audio \- audio device
4 .SH SYNOPSIS
5 .nf
6 .B bind -a #A /dev
7 .sp 0.3v
8 .B /dev/audio
9 .B /dev/volume
10 .fi
11 .SH DESCRIPTION
12 The audio device serves a one-level directory,
13 giving access to the stereo audio ports.
14 .B Audio
15 is the data file, which can be written for audio playback.
16 Audio data is a sequence of stereo samples, left sample first.
17 Each sample is a 16 bit little-endian two's complement integer;
18 the default sampling rate is 44.1 kHz.
19 .PP
20 The length of the
21 .B audio
22 file as returned by
23 .IR stat (2)
24 represents the number of bytes buffered for input or output.
25 .PP
26 .B Volume
27 is the control file associated with the audio port.
28 Each input and output source has an associated stereo volume control,
29 ranging from 0 (quiet) to 100 (loud).
30 In addition, there are controls for the sampling rate of the D/A and A/D converters
31 latency control and for any tone controls.
32 Reads
33 return lines of the form
34 .IP
35 .I source
36 .B in left
37 .I value 
38 .B right
39 .I value
40 .B out left
41 .I value
42 .B right
43 .I value
44 .PP
45 possibly abbreviated if the values are shared or non-existent.
46 For example, if all of the values are shared, the form degenerates to
47 .RI ` source
48 .IR value '.
49 Valid sources depend on the particular audio device,
50 though all devices have an
51 .B audio
52 stereo source, which controls the output volume from the D/A converter
53 connected to
54 .BR audio .
55 .PP
56 Writes accept the same format with same abbreviations.
57 .SH SOURCE
58 .B /sys/src/9/port/devaudio.c
59 .SH SEE ALSO
60 .IR nusb (4)