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