[BACK]Return to aucat.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / aucat

Annotation of src/usr.bin/aucat/aucat.1, Revision 1.69

1.69    ! ratchov     1: .\"    $OpenBSD: aucat.1,v 1.68 2010/04/21 06:13:07 ratchov Exp $
1.1       kstailey    2: .\"
1.16      ratchov     3: .\" Copyright (c) 2006 Alexandre Ratchov <alex@caoua.org>
1.1       kstailey    4: .\"
1.16      ratchov     5: .\" Permission to use, copy, modify, and distribute this software for any
                      6: .\" purpose with or without fee is hereby granted, provided that the above
                      7: .\" copyright notice and this permission notice appear in all copies.
1.1       kstailey    8: .\"
1.16      ratchov     9: .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     10: .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     11: .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     12: .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     13: .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
                     14: .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
                     15: .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1       kstailey   16: .\"
1.69    ! ratchov    17: .Dd $Mdocdate: April 21 2010 $
1.1       kstailey   18: .Dt AUCAT 1
1.5       aaron      19: .Os
1.1       kstailey   20: .Sh NAME
                     21: .Nm aucat
1.47      ratchov    22: .Nd audio server and stream manipulation tool
1.1       kstailey   23: .Sh SYNOPSIS
                     24: .Nm aucat
1.16      ratchov    25: .Bk -words
1.59      ratchov    26: .Op Fl dlnu
1.49      jmc        27: .Op Fl b Ar nframes
1.16      ratchov    28: .Op Fl C Ar min : Ns Ar max
                     29: .Op Fl c Ar min : Ns Ar max
                     30: .Op Fl e Ar enc
1.9       millert    31: .Op Fl f Ar device
1.16      ratchov    32: .Op Fl h Ar fmt
                     33: .Op Fl i Ar file
1.68      ratchov    34: .Op Fl j Ar flag
1.37      ratchov    35: .Op Fl m Ar mode
1.16      ratchov    36: .Op Fl o Ar file
1.66      ratchov    37: .Op Fl q Ar device
1.16      ratchov    38: .Op Fl r Ar rate
1.57      ratchov    39: .Op Fl s Ar name
1.62      ratchov    40: .Op Fl t Ar mode
1.54      ratchov    41: .Op Fl U Ar unit
1.30      ratchov    42: .Op Fl v Ar volume
1.22      ratchov    43: .Op Fl x Ar policy
1.62      ratchov    44: .Op Fl z Ar nframes
1.16      ratchov    45: .Ek
1.1       kstailey   46: .Sh DESCRIPTION
                     47: The
1.7       aaron      48: .Nm
1.16      ratchov    49: utility can record one input stream
                     50: and store it on multiple destination files,
                     51: doing the necessary conversions on the fly.
1.48      ratchov    52: It can play, convert, and mix multiple input files simultaneously,
                     53: and can also act as an audio server.
1.9       millert    54: .Nm
1.16      ratchov    55: also has a legacy mode that works like previous versions of
                     56: .Nm ,
                     57: which does not convert on the fly and supports playback of .au files.
1.17      jmc        58: .Pp
1.16      ratchov    59: The options are as follows:
1.26      ratchov    60: .Bl -tag -width Ds
1.49      jmc        61: .It Fl b Ar nframes
1.66      ratchov    62: The buffer size of the audio device in frames.
1.49      jmc        63: A frame consists of one sample for each channel in the stream.
                     64: This is the number of frames that will be buffered before being played
                     65: and thus controls the playback latency.
1.25      jmc        66: .It Xo
                     67: .Fl C Ar min : Ns Ar max ,
                     68: .Fl c Ar min : Ns Ar max
                     69: .Xc
1.26      ratchov    70: The range of channel numbers on the record or playback stream, respectively.
1.17      jmc        71: The default is 0:1, i.e. stereo.
1.59      ratchov    72: .It Fl d
                     73: Do not daemonize.
                     74: If this option is specified,
                     75: .Nm
                     76: will run in the foreground and log to
                     77: .Em stderr .
1.26      ratchov    78: .It Fl e Ar enc
                     79: Encoding of the playback or recording stream (see below).
1.17      jmc        80: The default is signed, 16-bit, native byte order.
                     81: .It Fl f Ar device
                     82: The
1.57      ratchov    83: .Xr sndio 7
                     84: audio device to use for playing and/or recording.
1.26      ratchov    85: .It Fl h Ar fmt
                     86: File format of the playback or record stream (see below).
1.17      jmc        87: The default is auto.
1.16      ratchov    88: .It Fl i Ar file
                     89: Add this file to the list of files to play.
                     90: If the option argument is
                     91: .Sq -
                     92: then standard input will be used.
1.68      ratchov    93: .It Fl j Ar flag
                     94: Control whether channels are joined or expanded if
                     95: the stream number of channels is not equal to the device number of channels.
                     96: If the flag is
                     97: .Va off
                     98: then stream channels are routed to the corresponding
                     99: device channel, possibly discarding channels not present in the device.
                    100: If the flag is
                    101: .Va on ,
                    102: then a single stream channel may be sent on multiple device channels,
                    103: or multiple stream channels may be sent to a single device channel.
                    104: For instance, this feature could be used to request mono streams to
                    105: be sent on multiple outputs or to record a stereo input into a mono stream.
                    106: The default is
                    107: .Ar on .
1.26      ratchov   108: .It Fl l
1.60      sobrado   109: Listen for incoming connections on a
1.61      sobrado   110: .Ux Ns -domain
                    111: socket.
1.39      jmc       112: This allows clients to use
1.26      ratchov   113: .Nm
1.57      ratchov   114: instead of the physical audio device for audio input and output
1.26      ratchov   115: in order to share the physical device with other clients.
1.57      ratchov   116: The default
                    117: .Xr sndio 7
                    118: device exposed is
                    119: .Pa aucat:0
                    120: .Pq "also known as" Pa aucat:0.default
1.45      ratchov   121: but other names can be used with the
1.35      ratchov   122: .Fl s
                    123: option.
1.37      ratchov   124: .It Fl m Ar mode
1.66      ratchov   125: Set the stream mode.
1.37      ratchov   126: Valid modes are
1.39      jmc       127: .Ar play ,
                    128: .Ar rec ,
1.37      ratchov   129: and
1.66      ratchov   130: .Ar mon ,
                    131: corresponding to playback, recording and monitoring.
                    132: A monitoring stream is a fake recording stream corresponding to
                    133: the mix of all playback streams.
                    134: Multiple modes can be specified, separated by commas,
                    135: but the same stream cannot be used for both recording and monitoring.
1.37      ratchov   136: The default is
1.67      jmc       137: .Ar play , Ns Ar rec
1.66      ratchov   138: (i.e. full-duplex).
1.42      ratchov   139: .It Fl n
                    140: Loopback mode.
                    141: Instead of using an audio device, send input streams
                    142: to the output, processing them on the fly.
                    143: This mode is useful to mix, demultiplex, resample or reencode
1.43      jmc       144: audio files offline.
1.16      ratchov   145: .It Fl o Ar file
                    146: Add this file to the list of files in which to store recorded samples.
                    147: If the option argument is
                    148: .Sq -
                    149: then standard output will be used.
1.66      ratchov   150: .It Fl q Ar device
                    151: The
                    152: .Xr sndio 7
                    153: MIDI device to use for controlling stream volumes or
                    154: to start multiple streams synchronously.
1.26      ratchov   155: .It Fl r Ar rate
                    156: Sample rate in Hertz of the playback or record stream.
1.17      jmc       157: The default is 44100Hz.
1.57      ratchov   158: .It Fl s Ar name
                    159: Add
                    160: .Ar name
                    161: to the list of sub-devices to expose in server mode.
                    162: Defining multiple sub-devices allows splitting a physical audio device
1.63      jmc       163: into logical devices having different properties (e.g. channel ranges).
1.57      ratchov   164: The given
                    165: .Ar name
1.62      ratchov   166: corresponds to the
1.57      ratchov   167: .Dq option
                    168: part of the
                    169: .Xr sndio 7
                    170: device name string.
1.62      ratchov   171: .It Fl t Ar mode
1.67      jmc       172: Select the way sub-devices are controlled by MIDI Machine Control (MMC)
                    173: messages.
1.62      ratchov   174: If the mode is
                    175: .Va off
                    176: (the default), then streams are not affected by MMC messages.
                    177: If the mode is
                    178: .Va slave ,
                    179: then streams are started synchronously by MMC start messages;
1.67      jmc       180: additionally, the server clock is exposed as MIDI Time Code (MTC)
1.62      ratchov   181: messages allowing MTC-capable software or hardware to be synchronized
                    182: to audio streams.
1.54      ratchov   183: .It Fl U Ar unit
                    184: Unit number to use when running in server mode.
                    185: Each
                    186: .Nm
                    187: server instance has an unique unit number,
                    188: used in
                    189: .Xr sndio 7
                    190: device names.
                    191: The default is 0.
1.16      ratchov   192: .It Fl u
1.21      jmc       193: Normally
                    194: .Nm
                    195: tries to automatically determine the optimal parameters for the audio device;
                    196: if this option is specified,
                    197: it will instead use the parameters specified by the
1.26      ratchov   198: .Fl Ccer
1.21      jmc       199: options.
1.30      ratchov   200: .It Fl v Ar volume
                    201: Software volume attenuation of the playback stream.
                    202: The value must be between 1 and 127,
1.31      jmc       203: corresponding to \-42dB and \-0dB attenuation.
1.33      ratchov   204: In server mode, clients inherit this parameter.
1.34      jmc       205: Reducing the volume in advance reduces a client's dynamic range,
                    206: but allows client volume to stay independent from the number
1.33      ratchov   207: of clients as long as their number is small enough.
1.34      jmc       208: A good compromise is to use \-4dB attenuation (12 volume units)
                    209: for each additional client expected
                    210: (115 if 2 clients are expected, 103 for 3 clients, and so on).
1.26      ratchov   211: .It Fl x Ar policy
1.22      ratchov   212: Action when the output stream cannot accept
1.26      ratchov   213: recorded data fast enough or the input stream
                    214: cannot provide data to play fast enough.
1.22      ratchov   215: If the policy
                    216: is
1.23      jmc       217: .Dq ignore
1.26      ratchov   218: (the default) then samples that cannot be written are discarded
                    219: and samples that cannot be read are replaced by silence.
1.22      ratchov   220: If the policy is
1.23      jmc       221: .Dq sync
1.26      ratchov   222: then recorded samples are discarded, but the same amount of silence will be written
1.22      ratchov   223: once the stream is unblocked, in order to reach the right position in time.
1.26      ratchov   224: Similarly silence is played, but the same amount of samples will be discarded
                    225: once the stream is unblocked.
1.22      ratchov   226: If the policy is
1.23      jmc       227: .Dq error
                    228: then the stream is closed permanently.
1.62      ratchov   229: .Pp
1.67      jmc       230: If a sub-device is created with the
                    231: .Fl t
                    232: option,
1.63      jmc       233: the
1.62      ratchov   234: .Dq ignore
1.63      jmc       235: action is disabled for any stream connected to it
                    236: to ensure proper synchronization.
1.62      ratchov   237: .It Fl z Ar nframes
                    238: The audio block size in frames.
1.63      jmc       239: This is the number of frames between audio clock ticks,
                    240: i.e. the clock resolution.
1.67      jmc       241: If a sub-device is created with the
                    242: .Fl t
                    243: option,
                    244: and MTC is used for synchronization, the clock
1.62      ratchov   245: resolution must be 96, 100 or 120 ticks per second for maximum
1.63      jmc       246: accuracy.
                    247: For instance, 120 ticks per second at 48000Hz corresponds
                    248: to a 400 frame block size.
1.21      jmc       249: .El
                    250: .Pp
1.32      ratchov   251: If
                    252: .Nm
                    253: is sent
1.44      ratchov   254: .Dv SIGHUP ,
                    255: .Dv SIGINT
                    256: or
                    257: .Dv SIGTERM ,
1.32      ratchov   258: it terminates recording to files.
                    259: .Pp
1.35      ratchov   260: Settings for input files
                    261: .Pq Fl i ,
                    262: output files
1.39      jmc       263: .Pq Fl o ,
1.57      ratchov   264: and sub-devices
1.35      ratchov   265: .Pq Fl s
                    266: can be changed using the
                    267: .Fl Ccehrvx
1.16      ratchov   268: options.
1.21      jmc       269: The last
1.35      ratchov   270: .Fl Ccehrvx
1.23      jmc       271: options specified before an
1.35      ratchov   272: .Fl i ,
1.39      jmc       273: .Fl o ,
                    274: or
1.35      ratchov   275: .Fl s
1.41      jmc       276: are applied to the corresponding file.
1.21      jmc       277: .Pp
                    278: Settings for the audio device
                    279: can be changed using the
1.26      ratchov   280: .Fl Ccer
1.21      jmc       281: options.
                    282: They apply to the audio device only if the
                    283: .Fl u
                    284: option is given as well.
                    285: The last
1.26      ratchov   286: .Fl Ccer
1.21      jmc       287: option specified before an
1.16      ratchov   288: .Fl f
1.21      jmc       289: is applied to
                    290: .Ar device .
                    291: .Pp
                    292: If no audio device
                    293: .Pq Fl f
1.53      ratchov   294: is specified,
                    295: settings are applied as if
                    296: the default device is specified as the last argument.
1.57      ratchov   297: If no sub-devices
1.53      ratchov   298: .Pq Fl s
                    299: are specified
                    300: settings are applied as if
1.57      ratchov   301: .Ar default
                    302: is specified as the last argument.
1.14      jmc       303: .Pp
1.20      jmc       304: File formats are specified using the
                    305: .Fl h
1.26      ratchov   306: option.
1.16      ratchov   307: The following file formats are supported:
1.66      ratchov   308: .Bl -tag -width s32lexxx -offset indent
1.16      ratchov   309: .It raw
                    310: Headerless file.
1.17      jmc       311: This format is recommended since it has no limitations.
1.16      ratchov   312: .It wav
                    313: Microsoft WAVE file format.
                    314: There are limitations inherent to the file format itself:
                    315: not all encodings are supported,
                    316: file sizes are limited to 2GB,
1.17      jmc       317: and the file must support the
1.16      ratchov   318: .Xr lseek 2
1.17      jmc       319: operation (e.g. pipes do not support it).
1.16      ratchov   320: .It auto
                    321: Try to guess, depending on the file name.
1.9       millert   322: .El
                    323: .Pp
1.20      jmc       324: Encodings are specified using the
                    325: .Fl e
1.26      ratchov   326: option.
1.16      ratchov   327: The following encodings are supported:
                    328: .Pp
1.66      ratchov   329: .Bl -tag -width s32lexxx -offset indent -compact
1.16      ratchov   330: .It s8
                    331: signed 8-bit
                    332: .It u8
                    333: unsigned 8-bit
                    334: .It s16le
                    335: signed 16-bit, little endian
                    336: .It u16le
                    337: unsigned 16-bit, little endian
                    338: .It s16be
                    339: signed 16-bit, big endian
                    340: .It u16be
                    341: unsigned 16-bit, big endian
                    342: .It s24le
                    343: signed 24-bit, stored in 4 bytes, little endian
                    344: .It u24le
                    345: unsigned 24-bit, stored in 4 bytes, little endian
                    346: .It s24be
                    347: signed 24-bit, stored in 4 bytes, big endian
                    348: .It u24be
                    349: unsigned 24-bit, stored in 4 bytes, big endian
                    350: .It s32le
                    351: signed 32-bit, little endian
                    352: .It u32le
                    353: unsigned 32-bit, little endian
                    354: .It s32be
                    355: signed 32-bit, big endian
                    356: .It u32be
                    357: unsigned 32-bit, big endian
                    358: .It s24le3
                    359: signed 24-bit, packed in 3 bytes, little endian
                    360: .It u24le3
                    361: unsigned 24-bit, packed in 3 bytes, big endian
                    362: .It s24be3
                    363: signed 24-bit, packed in 3 bytes, little endian
                    364: .It u24be3
                    365: unsigned 24-bit, packed in 3 bytes, big endian
                    366: .It s20le3
                    367: signed 20-bit, packed in 3 bytes, little endian
                    368: .It u20le3
                    369: unsigned 20-bit, packed in 3 bytes, big endian
                    370: .It s20be3
                    371: signed 20-bit, packed in 3 bytes, little endian
                    372: .It u20be3
                    373: unsigned 20-bit, packed in 3 bytes, big endian
                    374: .It s18le3
                    375: signed 18-bit, packed in 3 bytes, little endian
                    376: .It u18le3
                    377: unsigned 18-bit, packed in 3 bytes, big endian
                    378: .It s18be3
                    379: signed 18-bit, packed in 3 bytes, little endian
                    380: .It u18be3
                    381: unsigned 18-bit, packed in 3 bytes, big endian
                    382: .El
1.46      ratchov   383: .Sh SERVER MODE
                    384: .Nm
                    385: can be used in server mode
                    386: .Pq Fl l
                    387: to overcome hardware limitations and allow applications
                    388: to run on fixed sample rate devices or on devices
                    389: supporting only unusual encodings.
1.69    ! ratchov   390: .Pp
        !           391: The
        !           392: .Nm
        !           393: audio server may be started by the super-user,
        !           394: in which case any user will be able to connect to it.
        !           395: For privacy reasons, only one user may have connections to it
        !           396: at a given time.
        !           397: .Pp
        !           398: Alternatively, each user may run his instance
        !           399: of the server.
1.46      ratchov   400: It is generally not desirable to have multiple
                    401: instances of
                    402: .Nm
                    403: running in server mode,
                    404: so it is good practice to start it thus:
                    405: .Bd -literal -offset indent
                    406: $ pgrep -x aucat || aucat -l
                    407: .Ed
                    408: .Pp
                    409: This also ensures privacy by preventing
                    410: other users from accessing the audio system.
                    411: On multi-user machines
                    412: .Nm
                    413: should be killed when no longer in use to make audio resources
                    414: available again to others:
                    415: .Bd -literal -offset indent
                    416: $ pkill -x aucat
                    417: .Ed
                    418: .Pp
                    419: Certain applications, such as synthesis software,
                    420: require a low latency audio setup.
                    421: To reduce the probability of buffer underruns or overruns,
                    422: the
                    423: .Xr renice 8
1.49      jmc       424: command can be used to give a higher priority to the
1.46      ratchov   425: .Nm
1.49      jmc       426: process.
1.46      ratchov   427: Superuser privileges are required.
                    428: For example:
                    429: .Bd -literal -offset indent
                    430: $ aucat -b 3500 -l
                    431: $ sudo renice -n -20 -p `pgrep -x aucat`
                    432: .Ed
1.55      ratchov   433: .Sh MIDI CONTROL
                    434: While running in server mode
                    435: .Pq Fl l
                    436: .Nm
                    437: exposes a MIDI device with the same name as the default audio
                    438: device.
1.62      ratchov   439: It allows MIDI hardware or software to control programs
                    440: using
                    441: .Nm
                    442: or to synchronize to them.
                    443: .Pp
1.56      jmc       444: A MIDI channel is assigned to each stream, and the volume
1.55      ratchov   445: is changed using the standard volume controller (number 7).
                    446: Similarly, when the audio application changes its volume,
                    447: the same MIDI controller message is sent out; it can be used
1.56      jmc       448: for instance for monitoring or as feedback for motorized
1.55      ratchov   449: faders.
1.62      ratchov   450: .Pp
1.67      jmc       451: Clients connected to sub-devices created with the
1.63      jmc       452: .Fl t
1.67      jmc       453: option are controlled by the following MMC messages:
1.66      ratchov   454: .Bl -tag -width relocateXXX -offset indent
1.62      ratchov   455: .It relocate
                    456: Gives
                    457: .Nm
                    458: the time, relative to the beginning of the stream, at which playback
                    459: and recording must start.
                    460: It is not interpreted by
                    461: .Nm
                    462: itself.
1.63      jmc       463: The given time position is sent to MIDI clients as an MTC
1.62      ratchov   464: .Dq "full frame"
                    465: message forcing all MTC-slaves to relocate to the given
                    466: position (see below).
                    467: .It start
                    468: Put the sub-device in starting mode.
                    469: In this mode, the sub-device waits for all streams to become ready
                    470: to start, and then starts them synchronously.
                    471: Once started, new streams can be created, but they will be blocked
                    472: until the next stop-to-start transition.
1.67      jmc       473: .It stop
                    474: Put the sub-device in stopped mode (the default).
                    475: In this mode, any stream attempting to start playback or recording
                    476: is paused.
                    477: Streams that are already started are not affected until they stop
                    478: and try to start again.
1.62      ratchov   479: .El
                    480: .Pp
1.67      jmc       481: Sub-devices created with the
1.63      jmc       482: .Fl t
1.67      jmc       483: option export the server clock using MTC, allowing non-audio
1.62      ratchov   484: software or hardware to be synchronized to the audio stream.
                    485: The following sample rates
                    486: .Pq Fl r
                    487: and block sizes
                    488: .Pq Fl z
                    489: are recommended for maximum accuracy:
                    490: .Pp
1.66      ratchov   491: .Bl -bullet -offset indent -compact
1.62      ratchov   492: .It
                    493: 44100Hz, 441 frames
                    494: .It
                    495: 48000Hz, 400 frames
                    496: .It
                    497: 48000Hz, 480 frames
                    498: .It
                    499: 48000Hz, 500 frames
                    500: .El
                    501: .Pp
                    502: For instance, the following command will create two devices:
                    503: the default
                    504: .Va aucat:0
1.63      jmc       505: and a MIDI-controlled
                    506: .Va aucat:0.mmc :
1.62      ratchov   507: .Bd -literal -offset indent
                    508: $ aucat -l -r 48000 -z 400 -s default -t slave -s mmc
                    509: .Ed
                    510: .Pp
                    511: Streams connected to
                    512: .Va aucat:0
                    513: behave normally, while streams connected to
                    514: .Va aucat:0.mmc
                    515: wait for the MMC start signal and start synchronously.
1.63      jmc       516: Regardless of which device a stream is connected to,
                    517: its playback volume knob is exposed.
1.66      ratchov   518: .Pp
                    519: If
                    520: .Nm
                    521: is used to play and record audio files, it offers
                    522: similar MIDI control.
                    523: .Nm
                    524: can open a
                    525: .Xr sndio 7
                    526: MIDI device allowing MIDI hardware or software
                    527: to control playback and recording in real time.
                    528: .Pp
                    529: A MIDI channel is assigned to each stream, and the volume
                    530: is changed using the standard volume controller (number 7).
1.67      jmc       531: Streams created with the
1.66      ratchov   532: .Fl t
1.67      jmc       533: option are controlled by the following MMC messages:
1.66      ratchov   534: .Bl -tag -width relocateXXX -offset indent
1.67      jmc       535: .It relocate
                    536: Streams are relocated to the requested time postion
                    537: relative to the beginning of the stream, at which playback
                    538: and recording must start.
                    539: If the requested position is beyond the end of file,
                    540: the stream is temporarly disabled until a valid postion is requested.
1.66      ratchov   541: .It start
                    542: Start all streams synchronously.
                    543: By default, streams are created in a stopped state.
                    544: .It stop
                    545: Playback or recording is stopped, and
                    546: the stream is rewound back to the starting position.
                    547: .El
                    548: .Pp
                    549: For instance, the following command will play a file on the
                    550: .Va aucat:0.mmc
                    551: audio device, and give full control to MIDI software or hardware
                    552: connected to the
                    553: .Va midithru:0
                    554: MIDI device:
                    555: .Bd -literal -offset indent
                    556: $ aucat -f aucat:0.mmc -t slave -q midithru:0 -i file.wav
                    557: .Ed
                    558: .Pp
                    559: At this stage,
                    560: .Nm
                    561: will start, stop and relocate automatically following all user
                    562: actions in the MIDI sequencer.
                    563: Note that the sequencer must use
                    564: .Va aucat:0
                    565: as the MTC source, i.e. the audio server, not the audio player.
1.16      ratchov   566: .Sh LEGACY MODE
                    567: If neither
                    568: .Fl i
                    569: nor
                    570: .Fl o
1.17      jmc       571: are specified,
1.16      ratchov   572: .Nm
1.17      jmc       573: will run in legacy mode, and won't convert sample formats or sampling rates.
1.16      ratchov   574: In legacy mode, all options except
1.17      jmc       575: .Fl f
                    576: are ignored, and all other arguments are assumed to be names of files.
1.16      ratchov   577: In legacy mode
                    578: .Nm
                    579: reads files sequentially, and writes them to the specified device.
                    580: If a Sun .au header is detected it is skipped over and not copied to
                    581: the audio device.
                    582: .Nm
1.52      jakemsr   583: will attempt to parse the format, number of channels and sample rate
                    584: from Sun .au file headers.
                    585: However, only alaw and ulaw formats are supported for .au files.
                    586: Other formats will be interpreted as ulaw.
1.16      ratchov   587: If a Microsoft .wav header (RIFF) is detected it is interpreted
                    588: to select the right audio encoding for playback and the data chunk of the
                    589: file is copied to the audio device.
                    590: If the device does not support the encoding,
                    591: .Nm
                    592: will exit with an error.
1.9       millert   593: .Sh ENVIRONMENT
1.35      ratchov   594: .Bl -tag -width "AUDIODEVICE" -compact
1.24      jmc       595: .It Ev AUDIODEVICE
1.57      ratchov   596: .Xr sndio 7
                    597: audio device to use if the
1.50      ratchov   598: .Fl f
                    599: option is not specified.
1.9       millert   600: .El
1.16      ratchov   601: .Sh EXAMPLES
                    602: The following will mix and play two stereo streams,
                    603: the first at 48kHz and the second at 44.1kHz:
                    604: .Bd -literal -offset indent
                    605: $ aucat -r 48000 -i file1.raw -r 44100 -i file2.raw
                    606: .Ed
                    607: .Pp
                    608: The following will record channels 2 and 3 into one stereo file and
                    609: channels 6 and 7 into another stereo file using a 96kHz sampling rate for
                    610: both:
                    611: .Bd -literal -offset indent
1.26      ratchov   612: $ aucat -r 96000 -C 2:3 -o file1.raw -C 6:7 -o file2.raw
1.42      ratchov   613: .Ed
                    614: .Pp
1.43      jmc       615: The following will split a stereo file into two mono files:
1.42      ratchov   616: .Bd -literal -offset indent
                    617: $ aucat -n -i stereo.wav -C 0:0 -o left.wav -C 1:1 -o right.wav
1.16      ratchov   618: .Ed
                    619: .Pp
1.35      ratchov   620: The following will start
                    621: .Nm
1.40      jmc       622: in server mode using default parameters, but will create an
1.57      ratchov   623: additional sub-device for output to channels 2:3 only (rear speakers
                    624: on most cards), exposing the
                    625: .Pa aucat:0
                    626: and
                    627: .Pa aucat:0.rear
                    628: devices:
1.35      ratchov   629: .Bd -literal -offset indent
1.45      ratchov   630: $ aucat -l -s default -c 2:3 -s rear
1.35      ratchov   631: .Ed
                    632: .Pp
                    633: The following will start
                    634: .Nm
1.57      ratchov   635: in server mode creating the default sub-device with low volume and
                    636: an additional sub-device for high volume output, exposing the
                    637: .Pa aucat:0
                    638: and
                    639: .Pa aucat:0.max
                    640: devices:
1.35      ratchov   641: .Bd -literal -offset indent
1.45      ratchov   642: $ aucat -l -v 65 -s default -v 127 -s max
1.16      ratchov   643: .Ed
1.2       kstailey  644: .Sh SEE ALSO
1.12      jmc       645: .Xr audioctl 1 ,
1.17      jmc       646: .Xr cdio 1 ,
1.9       millert   647: .Xr mixerctl 1 ,
1.54      ratchov   648: .Xr audio 4 ,
                    649: .Xr sndio 7
1.16      ratchov   650: .Sh BUGS
                    651: The
1.1       kstailey  652: .Nm
1.16      ratchov   653: utility assumes non-blocking I/O for input and output streams.
                    654: It will not work reliably on files that may block
                    655: (ordinary files block, pipes don't).
                    656: .Pp
                    657: Resampling is low quality; down-sampling especially should be avoided
                    658: when recording.
                    659: .Pp
                    660: Processing is done using 16-bit arithmetic,
                    661: thus samples with more than 16 bits are rounded.
1.17      jmc       662: 16 bits (i.e. 97dB dynamic) are largely enough for most applications though.