1.\" $NetBSD: audioplay.1,v 1.12 2001/12/01 17:15:06 wiz Exp $ 2.\" 3.\" Copyright (c) 1998-1999 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 March 30, 1999 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.Op Fl C Ar ctl 43.Oo 44.Fl f 45.Op Fl c Ar channels 46.Op Fl e Ar encoding 47.Op Fl P Ar precision 48.Op Fl s Ar sample-rate 49.Oc 50.Op files ... 51.Sh DESCRIPTION 52The 53.Nm 54program copies the named audiofiles, or the standard input if no files are 55named, to the audio device. The input files must contain a valid audio 56header, and the encoding must be understood by the underlying driver. 57.Sh OPTIONS 58The following options are available: 59.Bl -tag -width 123456 60.It Fl i 61If the audio device cannot be opened, exit now rather than wait for it. 62.It Fl q 63Be quiet. 64.It Fl V 65Be verbose. 66.It Fl h 67Print a help message. 68.It Fl v 69Set the volume (gain) to 70.Ar volume . 71This value must be between 0 and 255. 72.It Fl b 73Set the balance to 74.Ar balance . 75This value must be between 0 and 63. 76.It Fl p 77Set the output port to 78.Ar port . 79The valid values of 80.Ar port 81are 82.Dq speaker , 83.Dq headphone 84and 85.Dq line . 86.It Fl d 87Set the audio device to be 88.Ar device . 89The default is 90.Pa /dev/audio0 . 91.It Fl C 92Set the audio control device to be 93.Ar ctl . 94The default is 95.Pa /dev/audioctl0 . 96.It Fl f 97Force playing, even if the format is unknown. The 98.Fl f 99flag can be used in addition with the following flags to 100change the number of channels, encoding, precision and 101sample rate. 102.It Fl c 103when combined with the 104.Fl f 105option, sets the number of channels to its argument. 106.It Fl e 107when combined with the 108.Fl f 109option, sets the encoding to its argument. Possible values are 110.Cm mulaw , 111.Cm ulaw , 112.Cm alaw , 113.Cm slinear , 114.Cm linear , 115.Cm ulinear , 116.Cm adpcm , 117.Cm ADPCM , 118.Cm slinear_le , 119.Cm linear_le , 120.Cm ulinear_le , 121.Cm slinear_be , 122.Cm linear_be , 123.Cm ulinear_be , 124.Cm mpeg_l1_stream , 125.Cm mpeg_l1_packets , 126.Cm mpeg_l1_system , 127.Cm mpeg_l2_stream , 128.Cm mpeg_l2_packets , 129and 130.Cm mpeg_l2_system . 131.It Fl P 132when combined with the 133.Fl f 134option, sets the precision to its argument. This value must be either 1354, 8, 16, 24 or 32. 136.It Fl s 137when combined with the 138.Fl f 139option, sets the sample rate to its argument. This value must be a 140valid value for the audio device or an error will be returned. 141.El 142.Sh ENVIRONMENT 143.Bl -tag -width AUDIOCTLDEVICE 144.It AUDIOCTLDEVICE 145the audio control device to be used. 146.It AUDIODEVICE 147the audio device to be used. 148.El 149.Sh EXAMPLES 150Play a raw dump taken from an audio CD ROM: 151.Pp 152.Dl "audioplay -f -c 2 -P 16 -s 44100 -e slinear_le filename" 153.Pp 154The 155.Xr audioctl 1 156program can be used to show the available supported encodings: 157.Pp 158.Dl "audioctl encodings" 159.Sh NOTES 160.Nm 161can be used to play Sun/NeXT audio files, and also RIFF WAVE audio files. 162.Nm 163can be configured in the 164.Dq Netscape 165web browser as the program to use when playing audio files. 166.Sh ERRORS 167If the audio device or the control device can not be opened, and error is 168returned. 169.Pp 170If an invalid parameter is specified, an error is returned. The set of 171valid values for any audio parameter is specified by the hardware driver. 172.Sh SEE ALSO 173.Xr audioctl 1 , 174.Xr audiorecord 1 , 175.Xr aria 4 , 176.Xr audio 4 , 177.Xr audioamd 4 , 178.Xr eap 4 , 179.Xr eso 4 , 180.Xr ess 4 , 181.Xr gus 4 , 182.Xr guspnp 4 , 183.Xr sb 4 , 184.Xr sv 4 , 185.Xr wss 4 , 186.Xr ym 4 187.Sh HISTORY 188The 189.Nm 190program was first seen in SunOS 5. The 191.Nx 192.Nm 193was first made available in 194.Nx 1.4 . 195.Sh AUTHORS 196The 197.Nm 198program was written by Matthew R. Green <mrg@eterna.com.au>. 199