1 AUDIORECORD(1)                   User Commands                  AUDIORECORD(1)
   2 
   3 
   4 
   5 NAME
   6        audiorecord - record an audio file
   7 
   8 SYNOPSIS
   9        audiorecord [-af] [-v vol] [-c channels] [-s rate]
  10             [-e encoding] [-t time] [-i info] [-d dev]
  11             [-T au|aif[f]|wav] [file[.au|.aif[f]|.wav]]
  12 
  13 
  14 DESCRIPTION
  15        The audiorecord utility copies audio data from the audio device to a
  16        named audio file, or to the standard output if no filename is present.
  17        If no output file is specified and standard output is a tty, the
  18        program exits with an error message.
  19 
  20 
  21        By default, monaural audio data is recorded at 8 kHz and encoded in u-
  22        law format. If the audio device supports additional configurations, the
  23        -c, -s, and -e options may be used to specify the data format. The
  24        output file is prefixed by an audio file header that identifies the
  25        format of the data encoded in the file.
  26 
  27 
  28        Recording begins immediately and continues until a SIGINT signal (for
  29        example, Control-c) is received. If the -t option is specified,
  30        audiorecord stops when the specified quantity of data has been
  31        recorded.
  32 
  33 
  34        If the audio device is unavailable, that is, if another process
  35        currently has read access, audiorecord prints an error message and
  36        exits immediately.
  37 
  38 OPTIONS
  39        The following options are supported:
  40 
  41        -?
  42                                Help: Prints a command line usage message.
  43 
  44 
  45        -a
  46                                Append: Appends the data on the end of the
  47                                named audio file. The audio device must support
  48                                the audio data format of the existing file.
  49 
  50 
  51        -c channels
  52                                Channels: Specifies the number of audio
  53                                channels (1 or 2). The value may be specified
  54                                as an integer or as the string mono or stereo.
  55                                The default value is mono.
  56 
  57 
  58        -d dev
  59                                Device: The dev argument specifies an alternate
  60                                audio device from which input should be taken.
  61                                If the -d option is not specified, the AUDIODEV
  62                                environment variable is consulted (see below).
  63                                Otherwise, /dev/audio is used as the default
  64                                audio device.
  65 
  66 
  67        -e encoding
  68                                Encoding: Specifies the audio data encoding.
  69                                This value may be one of ulaw, alaw, or linear.
  70                                The default encoding is ulaw.
  71 
  72 
  73        -f
  74                                Force: When the -a flag is specified, the
  75                                sample rate of the audio device must match the
  76                                sample rate at which the original file was
  77                                recorded. If the -f flag is also specified,
  78                                sample rate differences are ignored, with a
  79                                warning message printed on the standard error.
  80 
  81 
  82        -i info
  83                                Information: The `information' field of the
  84                                output file header is set to the string
  85                                specified by the info argument. This option
  86                                cannot be specified in conjunction with the -a
  87                                argument.
  88 
  89 
  90        -s rate
  91                                Sample Rate: Specifies the sample rate, in
  92                                samples per second. If a number is followed by
  93                                the letter k, it is multiplied by 1000 (for
  94                                example, 44.1k = 44100). The default sample
  95                                rate is 8 kHz.
  96 
  97 
  98        -t time
  99                                Time: The time argument specifies the maximum
 100                                length of time to record. Time can be specified
 101                                as a floating-point value, indicating the
 102                                number of seconds, or in the form: hh:mm:ss.dd,
 103                                where the hour and minute specifications are
 104                                optional.
 105 
 106 
 107        -T au | aif[f] | wav
 108                                Specifies the audio file type to create. If the
 109                                -a option is used, the file type must match the
 110                                file to which it is being appended. Regardless
 111                                of the file suffix, the type is set as
 112                                specified in this option. If this option is not
 113                                specified, the file suffix determines the type.
 114 
 115 
 116        -v vol
 117                                Volume: The recording gain is set to the
 118                                specified value before recording begins, and is
 119                                reset to its previous level when audiorecord
 120                                exits. The vol argument is an integer value
 121                                between 0 and 100, inclusive. If this argument
 122                                is not specified, the input volume remains at
 123                                the level most recently set by any process.
 124 
 125 
 126 OPERANDS
 127        file[.au|.aif[f]|.wav]
 128 
 129            File Specification: The named audio file is rewritten, or appended.
 130            If no filename is present, and standard output is not a tty, or if
 131            the special filename "-" is specified, output is directed to the
 132            standard output.
 133 
 134            If the -T option is not specified, the file suffix determines the
 135            type of file. If the suffix is not recognized, the default is .au.
 136            If the -T option is specified, that file type is used regardless of
 137            the file suffix.
 138 
 139 
 140 USAGE
 141        See largefile(5) for the description of the behavior of audiorecord
 142        when encountering files greater than or equal to 2 Gbyte (2^31 bytes).
 143 
 144 ENVIRONMENT VARIABLES
 145        AUDIODEV
 146                    The full path name of the audio device to record from, if
 147                    no -d argument is supplied. If the AUDIODEV variable is not
 148                    set, /dev/audio is used.
 149 
 150 
 151 SEE ALSO
 152        audioconvert(1), audioplay(1), largefile(5), audio(7I)
 153 
 154 
 155 
 156                                February 8, 2020                 AUDIORECORD(1)