xref: /netbsd/usr.bin/audio/play/audioplay.1 (revision bf9ec67e)
1.\"	$NetBSD: audioplay.1,v 1.18 2002/02/26 00:15:57 augustss Exp $
2.\"
3.\" Copyright (c) 1998-2002 Matthew R. Green
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. The name of the author may not be used to endorse or promote products
15.\"    derived from this software without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.Dd January 13, 2002
30.Dt AUDIOPLAY 1
31.Os
32.Sh NAME
33.Nm audioplay
34.Nd play audio files
35.Sh SYNOPSIS
36.Nm
37.Op Fl iqVh
38.Op Fl v Ar volume
39.Op Fl b Ar balance
40.Op Fl p Ar port
41.Op Fl d Ar device
42.Oo
43.Fl f
44.Op Fl c Ar channels
45.Op Fl e Ar encoding
46.Op Fl P Ar precision
47.Op Fl s Ar sample-rate
48.Oc
49.Op files ...
50.Sh DESCRIPTION
51The
52.Nm
53program copies the named audiofiles, or the standard input if no files are
54named, to the audio device.  The special name
55.Dq -
56is assumed to mean the standard input.  The input files must contain a valid
57audio header, and the encoding must be understood by the underlying driver.
58.Sh OPTIONS
59The following options are available:
60.Bl -tag -width 123456
61.It Fl i
62If the audio device cannot be opened, exit now rather than wait for it.
63.It Fl q
64Be quiet.
65.It Fl V
66Be verbose.
67.It Fl h
68Print a help message.
69.It Fl v
70Set the volume (gain) to
71.Ar volume .
72This value must be between 0 and 255.
73.It Fl b
74Set the balance to
75.Ar balance .
76This value must be between 0 and 63.
77.It Fl p
78Set the output port to
79.Ar port .
80The valid values of
81.Ar port
82are
83.Dq speaker ,
84.Dq headphone
85and
86.Dq line .
87.It Fl d
88Set the audio device to be
89.Ar device .
90The default is
91.Pa /dev/sound .
92.It Fl f
93Force playing, even if the format is unknown.  The
94.Fl f
95flag can be used in addition with the following flags to
96change the number of channels, encoding, precision and
97sample rate.
98.It Fl c
99when combined with the
100.Fl f
101option, sets the number of channels to its argument.
102.It Fl e
103when combined with the
104.Fl f
105option, sets the encoding to its argument. Possible values are
106.Cm mulaw ,
107.Cm ulaw ,
108.Cm alaw ,
109.Cm slinear ,
110.Cm linear ,
111.Cm ulinear ,
112.Cm adpcm ,
113.Cm ADPCM ,
114.Cm slinear_le ,
115.Cm linear_le ,
116.Cm ulinear_le ,
117.Cm slinear_be ,
118.Cm linear_be ,
119.Cm ulinear_be ,
120.Cm mpeg_l1_stream ,
121.Cm mpeg_l1_packets ,
122.Cm mpeg_l1_system ,
123.Cm mpeg_l2_stream ,
124.Cm mpeg_l2_packets ,
125and
126.Cm mpeg_l2_system .
127.It Fl P
128when combined with the
129.Fl f
130option, sets the precision to its argument.  This value must be either
1314, 8, 16, 24 or 32.
132.It Fl s
133when combined with the
134.Fl f
135option, sets the sample rate to its argument.  This value must be a
136valid value for the audio device or an error will be returned.
137.El
138.Sh ENVIRONMENT
139.Bl -tag -width AUDIOCTLDEVICE
140.It AUDIOCTLDEVICE
141the audio control device to be used.
142.It AUDIODEVICE
143the audio device to be used.
144.El
145.Sh EXAMPLES
146Play a raw dump taken from an audio CD ROM:
147.Pp
148.Dl "audioplay -f -c 2 -P 16 -s 44100 -e slinear_le filename"
149.Pp
150The
151.Xr audioctl 1
152program can be used to show the available supported encodings:
153.Pp
154.Dl "audioctl encodings"
155.Sh NOTES
156.Nm
157can be used to play Sun/NeXT audio files, and also RIFF WAVE audio files.
158.Nm
159can be configured in the
160.Dq Netscape
161web browser as the program to use when playing audio files.
162.Sh ERRORS
163If the audio device or the control device can not be opened, and error is
164returned.
165.Pp
166If an invalid parameter is specified, an error is returned.  The set of
167valid values for any audio parameter is specified by the hardware driver.
168.Sh SEE ALSO
169.Xr audioctl 1 ,
170.Xr audiorecord 1 ,
171.Xr aria 4 ,
172.Xr audio 4 ,
173.Xr audioamd 4 ,
174.Xr auich 4 ,
175.Xr autri 4 ,
176.Xr auvia 4 ,
177.Xr clcs 4 ,
178.Xr clct 4 ,
179.Xr cmpci 4 ,
180.Xr eap 4 ,
181.Xr emuxki 4 ,
182.Xr esm 4 ,
183.Xr eso 4 ,
184.Xr ess 4 ,
185.Xr fms 4 ,
186.Xr gus 4 ,
187.Xr guspnp 4 ,
188.Xr neo 4 ,
189.Xr sb 4 ,
190.Xr sv 4 ,
191.Xr wss 4 ,
192.Xr yds 4 ,
193.Xr ym 4
194.Sh HISTORY
195The
196.Nm
197program was first seen in SunOS 5.  The
198.Nx
199.Nm
200was first made available in
201.Nx 1.4 .
202.Sh AUTHORS
203The
204.Nm
205program was written by Matthew R. Green \*[Lt]mrg@eterna.com.au\*[Gt].
206