[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.66

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