1.\" $NetBSD: audiorecord.1,v 1.40 2010/12/29 18:46:49 wiz Exp $ 2.\" 3.\" Copyright (c) 1998, 1999, 2001, 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 AUDIORECORD 1 29.Os 30.Sh NAME 31.Nm audiorecord 32.Nd record audio files 33.Sh SYNOPSIS 34.Nm 35.Op Fl afhqV 36.Op Fl B Ar buffersize 37.Op Fl b Ar balance 38.Op Fl c Ar channels 39.Op Fl d Ar device 40.Op Fl e Ar encoding 41.Op Fl F Ar format 42.Op Fl i Ar info 43.Op Fl m Ar monvol 44.Op Fl P Ar precision 45.Op Fl p Ar port 46.Op Fl s Ar rate 47.Op Fl t Ar time 48.Op Fl v Ar volume 49.Ar file 50.Sh DESCRIPTION 51The 52.Nm 53program copies the audio device to the named audiofile or, 54if the file name is -, to the standard output. 55.Pp 56The output file will contain either a Sun/NeXT audio header, a 57RIFF/WAVE audio header or no header at all. 58Sun output files using a linear PCM encoding are written with big-endian 59signed samples, possibly after converting these from little-endian or 60unsigned samples. 61RIFF/WAVE files are written in little-endian, signed samples, also 62converting if necessary. 63The default output is Sun/NeXT format, but if the output file 64.Ar file 65ends with a 66.Pa .wav 67file extension it will be written as RIFF/WAVE. 68.Sh OPTIONS 69The following options are available: 70.Bl -tag -width XpXprecisionX 71.It Fl a 72Append to the specified file, rather than overwriting. 73.It Fl B Ar buffersize 74Set the audio device read buffer size to 75.Ar buffersize . 76The default value is the record.buffer_size of the audio device. 77.It Fl b Ar balance 78Set the balance to 79.Ar balance . 80This value must be between 0 and 63. 81.It Fl c Ar channels 82Set number of channels to 83.Ar channels . 84.It Fl d Ar device 85Set the audio device to be 86.Ar device . 87The default is 88.Pa /dev/sound . 89.It Fl e Ar encoding 90Set encoding to either 91.Dq alaw , 92.Dq ulaw , 93or 94.Dq linear , 95or any other value reported by 96.Ic audioctl encodings . 97The default encoding is 98.Dq ulaw . 99If the output format is 100.Dq sun , 101the file will contain slinear_be samples, if it is 102.Dq wav , 103then slinear_le, independent of the argument to 104.Fl e . 105Setting the argument to 106.Fl e 107still may be important since it is used in an 108.Xr ioctl 2 109call to the kernel to choose the kind of data provided. 110.It Fl F Ar format 111Set the output header format to 112.Ar format . 113Currently supported formats are 114.Dq sun , 115.Dq wav , 116and 117.Dq none 118for Sun/NeXT audio, WAV, and no header, respectively. 119.It Fl f 120Force. 121Normally when appending to audiofiles using the 122.Fl a 123option, the sample rates must match. 124The 125.Fl f 126option will allow a discrepancy to be ignored. 127.It Fl h 128Print a help message. 129.It Fl i Ar info 130If supported by the 131.Fl F 132format, add the string 133.Ar info 134to the output header. 135.It Fl m Ar monvol 136Set the monitor volume. 137.It Fl P Ar precision 138Set the precision. 139This value is the number of bits per sample, and is normally either 140.Dq 8 141or 142.Dq 16 , 143though the values 144.Dq 4 , 145.Dq 24 , 146and 147.Dq 32 148are also valid. 149.It Fl p Ar port 150Set the input port to 151.Ar port . 152The valid values of 153.Ar port 154are 155.Dq cd , 156.Dq internal-cd , 157.Dq mic , 158and 159.Dq line . 160.It Fl q 161Be quiet. 162.It Fl s Ar rate 163Set the sampling rate. 164This value is per-second. 165Typical values are 8000, 44100, and 48000, which are the telephone, 166CD Audio, and DAT Audio default sampling rates. 167.It Fl t Ar time 168Sets the maximum amount of time to record. 169Format is [hh:]mm:ss[.dddddd]. 170.It Fl V 171Be verbose. 172.It Fl v Ar volume 173Set the volume (gain) to 174.Ar volume . 175This value must be between 0 and 255. 176.El 177.Sh ENVIRONMENT 178.Bl -tag -width AUDIOCTLDEVICE 179.It AUDIOCTLDEVICE 180the audio control device to be used. 181.It AUDIODEVICE 182the audio device to be used. 183.El 184.Sh SEE ALSO 185.Xr audioctl 1 , 186.Xr audioplay 1 , 187.Xr aria 4 , 188.Xr audio 4 , 189.Xr audioamd 4 , 190.Xr auich 4 , 191.Xr autri 4 , 192.Xr auvia 4 , 193.Xr clcs 4 , 194.Xr clct 4 , 195.Xr cmpci 4 , 196.Xr eap 4 , 197.Xr emuxki 4 , 198.Xr esm 4 , 199.Xr eso 4 , 200.Xr ess 4 , 201.Xr fms 4 , 202.Xr gus 4 , 203.Xr guspnp 4 , 204.Xr neo 4 , 205.Xr sb 4 , 206.Xr sv 4 , 207.Xr wss 4 , 208.Xr yds 4 , 209.Xr ym 4 210.Sh HISTORY 211The 212.Nm 213program was first seen in SunOS 5. 214It was first made available in 215.Nx 1.4 . 216RIFF/WAVE support, and support for converting signed/unsigned and 217big/little-endian samples was first made available in 218.Nx 1.6 . 219.Sh AUTHORS 220The 221.Nm 222program was written by 223.An Matthew R. Green Aq mrg@eterna.com.au . 224.Sh BUGS 225WAV big-endian samples are converted to little-endian, rather than 226a RIFX header being written. 227