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