281 lines
11 KiB
HTML
281 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of APLAY</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>APLAY</H1>
|
|
Section: User Commands (1)<BR>Updated: 1 January 2010<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
arecord, aplay - command-line sound recorder and player for ALSA
|
|
soundcard driver
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>arecord</B> [<I>flags</I>] [filename]
|
|
<BR>
|
|
|
|
<B>aplay</B> [<I>flags</I>] [filename [filename]] ...
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>arecord</B> is a command-line soundfile recorder for the ALSA soundcard
|
|
driver. It supports several file formats and multiple soundcards with
|
|
multiple devices. If recording with interleaved mode samples the file is
|
|
automatically split before the 2GB filesize.
|
|
<P>
|
|
<B>aplay</B> is much the same, only it plays instead of recording. For
|
|
supported soundfile formats, the sampling rate, bit depth, and so
|
|
forth can be automatically determined from the soundfile header.
|
|
<P>
|
|
If filename is not specified, the standard output or input is used. The <B>aplay</B> utility accepts multiple filenames.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><I>-h, --help</I><DD>
|
|
Help: show syntax.
|
|
<DT id="2"><I>--version</I><DD>
|
|
Print current version.
|
|
<DT id="3"><I>-l, --list-devices</I><DD>
|
|
List all soundcards and digital audio devices
|
|
<DT id="4"><I>-L, --list-pcms</I><DD>
|
|
List all PCMs defined
|
|
<DT id="5"><I>-D, --device=NAME</I><DD>
|
|
Select PCM by name
|
|
<DT id="6"><I>-q --quiet</I><DD>
|
|
Quiet mode. Suppress messages (not sound :))
|
|
<DT id="7"><I>-t, --file-type TYPE</I><DD>
|
|
File type (voc, wav, raw or au).
|
|
If this parameter is omitted the WAVE format is used.
|
|
<DT id="8"><I>-c, --channels=#</I><DD>
|
|
The number of channels.
|
|
The default is one channel.
|
|
Valid values are 1 through 32.
|
|
<DT id="9"><I>-f --format=FORMAT</I><DD>
|
|
Sample format
|
|
<BR>
|
|
|
|
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE
|
|
S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE
|
|
FLOAT64_LE FLOAT64_BE IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW
|
|
A_LAW IMA_ADPCM MPEG GSM SPECIAL S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE
|
|
S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE
|
|
<BR>
|
|
|
|
Some of these may not be available on selected hardware
|
|
<BR>
|
|
|
|
The available format shortcuts are:
|
|
<PRE>
|
|
-f cd (16 bit little endian, 44100, stereo) [-f S16_LE -c2 -r44100]
|
|
-f cdr (16 bit big endian, 44100, stereo) [-f S16_BE -c2 -f44100]
|
|
-f dat (16 bit little endian, 48000, stereo) [-f S16_LE -c2 -r48000]
|
|
</PRE>
|
|
|
|
If no format is given U8 is used.
|
|
<DT id="10"><I>-r, --rate=#<Hz></I><DD>
|
|
Sampling rate in Hertz. The default rate is 8000 Hertz.
|
|
If the value specified is less than 300, it is taken as the rate in kilohertz.
|
|
Valid values are 2000 through 192000 Hertz.
|
|
<DT id="11"><I>-d, --duration=#</I><DD>
|
|
Interrupt after # seconds.
|
|
A value of zero means infinity.
|
|
The default is zero, so if this option is omitted then the record/playback process will run until it is killed.
|
|
Either '-d' or '-s' option is available exclusively.
|
|
<DT id="12"><I>-s, --samples=#</I><DD>
|
|
Interrupt after tranmission of # PCM frames.
|
|
A value of zero means infinity.
|
|
The default is zero, so if this options is omitted then the record/playback process will run until it is killed.
|
|
Either '-d' or '-s' option is available exclusively.
|
|
<DT id="13"><I>-M, --mmap</I> <DD>
|
|
Use memory-mapped (mmap) I/O mode for the audio stream.
|
|
If this option is not set, the read/write I/O mode will be used.
|
|
<DT id="14"><I>-N, --nonblock</I> <DD>
|
|
Open the audio device in non-blocking mode. If the device is busy the program will exit immediately.
|
|
If this option is not set the program will block until the audio device is available again.
|
|
<DT id="15"><I>-F, --period-time=#</I> <DD>
|
|
Distance between interrupts is # microseconds.
|
|
If no period time and no period size is given then a quarter of the buffer time is set.
|
|
<DT id="16"><I>-B, --buffer-time=#</I> <DD>
|
|
Buffer duration is # microseconds
|
|
If no buffer time and no buffer size is given then the maximal allowed buffer time but not more than 500ms is set.
|
|
<DT id="17"><I>--period-size=#</I> <DD>
|
|
Distance between interrupts is # frames
|
|
If no period size and no period time is given then a quarter of the buffer size is set.
|
|
<DT id="18"><I>--buffer-size=#</I> <DD>
|
|
Buffer duration is # frames
|
|
If no buffer time and no buffer size is given then the maximal allowed buffer time but not more than 500ms is set.
|
|
<DT id="19"><I>-A, --avail-min=#</I> <DD>
|
|
Min available space for wakeup is # microseconds
|
|
<DT id="20"><I>-R, --start-delay=#</I> <DD>
|
|
Delay for automatic PCM start is # microseconds
|
|
(relative to buffer size if <= 0)
|
|
<DT id="21"><I>-T, --stop-delay=#</I> <DD>
|
|
Delay for automatic PCM stop is # microseconds from xrun
|
|
<DT id="22"><I>-v, --verbose</I> <DD>
|
|
Show PCM structure and setup.
|
|
This option is accumulative. The VU meter is displayed when this
|
|
is given twice or three times.
|
|
<DT id="23"><I>-V, --vumeter=TYPE</I><DD>
|
|
Specifies the VU-meter type, either <I>stereo</I> or <I>mono</I>.
|
|
The stereo VU-meter is available only for 2-channel stereo samples
|
|
with interleaved format.
|
|
<DT id="24"><I>-I, --separate-channels</I> <DD>
|
|
One file for each channel. This option disables max-file-time
|
|
and use-strftime, and ignores SIGUSR1. The stereo VU meter is
|
|
not available with separate channels.
|
|
<DT id="25"><I>-P</I><DD>
|
|
Playback. This is the default if the program is invoked
|
|
by typing aplay.
|
|
<DT id="26"><I>-C</I><DD>
|
|
Record. This is the default if the program is invoked
|
|
by typing arecord.
|
|
<DT id="27"><I>-i, --interactive</I><DD>
|
|
Allow interactive operation via stdin.
|
|
Currently only pause/resume via space or enter key is implemented.
|
|
<DT id="28"><I>-m, --chmap=ch1,ch2,...</I><DD>
|
|
Give the channel map to override or follow. Pass channel position
|
|
strings like <I>FL</I>, <I>FR</I>, etc.
|
|
<P>
|
|
If a device supports the override of the channel map, <B>aplay</B>
|
|
tries to pass the given channel map.
|
|
If it doesn't support the channel map override but still it provides
|
|
the channel map information, <B>aplay</B> tries to rearrange the
|
|
channel order in the buffer to match with the returned channel map
|
|
from the device.
|
|
<DT id="29"><I>--disable-resample</I><DD>
|
|
Disable automatic rate resample.
|
|
<DT id="30"><I>--disable-channels</I><DD>
|
|
Disable automatic channel conversions.
|
|
<DT id="31"><I>--disable-format</I><DD>
|
|
Disable automatic format conversions.
|
|
<DT id="32"><I>--disable-softvol</I><DD>
|
|
Disable software volume control (softvol).
|
|
<DT id="33"><I>--test-position</I><DD>
|
|
Test ring buffer position.
|
|
<DT id="34"><I>--test-coef=<coef></I><DD>
|
|
Test coefficient for ring buffer position; default is 8.
|
|
Expression for validation is: coef * (buffer_size / 2).
|
|
Minimum value is 1.
|
|
<DT id="35"><I>--test-nowait</I><DD>
|
|
Do not wait for the ring buffer - eats the whole CPU.
|
|
<DT id="36"><I>--max-file-time</I><DD>
|
|
While recording, when the output file has been accumulating
|
|
sound for this long,
|
|
close it and open a new output file. Default is the maximum
|
|
size supported by the file format: 2 GiB for WAV files.
|
|
This option has no effect if --separate-channels is
|
|
specified.
|
|
<DT id="37"><I>--process-id-file <file name></I><DD>
|
|
aplay writes its process ID here, so other programs can
|
|
send signals to it.
|
|
<DT id="38"><I>--use-strftime</I><DD>
|
|
When recording, interpret %-codes in the file name parameter using
|
|
the strftime facility whenever the output file is opened. The
|
|
important strftime codes are: %Y is the year, %m month, %d day of
|
|
the month, %H hour, %M minute and %S second. In addition, %v is
|
|
the file number, starting at 1. When this option is specified,
|
|
intermediate directories for the output file are created automatically.
|
|
This option has no effect if --separate-channels is specified.
|
|
<DT id="39"><I>--dump-hw-params</I><DD>
|
|
Dump hw_params of the device preconfigured status to stderr. The dump
|
|
lists capabilities of the selected device such as supported formats,
|
|
sampling rates, numbers of channels, period and buffer bytes/sizes/times.
|
|
For raw device hw:X this option basically lists hardware capabilities of
|
|
the soundcard.
|
|
<DT id="40"><I>--fatal-errors</I><DD>
|
|
Disables recovery attempts when errors (e.g. xrun) are encountered; the
|
|
aplay process instead aborts immediately.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SIGNALS</H2>
|
|
|
|
When recording, SIGINT, SIGTERM and SIGABRT will close the output
|
|
file and exit. SIGUSR1 will close the output file, open a new one,
|
|
and continue recording. However, SIGUSR1 does not work with
|
|
--separate-channels.
|
|
<P>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
<P>
|
|
<DL COMPACT>
|
|
<DT id="41"><B>aplay -c 1 -t raw -r 22050 -f mu_law foobar</B><DD>
|
|
will play the raw file "foobar" as a
|
|
22050-Hz, mono, 8-bit, Mu-Law .au file.
|
|
<P>
|
|
<DT id="42"><B>arecord -d 10 -f cd -t wav -D copy foobar.wav</B><DD>
|
|
will record foobar.wav as a 10-second, CD-quality wave file, using the
|
|
PCM "copy" (which might be defined in the user's .asoundrc file as:
|
|
<PRE>
|
|
pcm.copy {
|
|
type plug
|
|
slave {
|
|
pcm hw
|
|
}
|
|
route_policy copy
|
|
}
|
|
</PRE>
|
|
|
|
<P>
|
|
<DT id="43"><B>arecord -t wav --max-file-time 30 mon.wav</B><DD>
|
|
Record from the default audio source in monaural, 8,000 samples
|
|
per second, 8 bits per sample. Start a new file every
|
|
30 seconds. File names are mon-nn.wav, where nn increases
|
|
from 01. The file after mon-99.wav is mon-100.wav.
|
|
<P>
|
|
<DT id="44"><B>arecord -f cd -t wav --max-file-time 3600 --use-strftime %Y/%m/%d/listen-%H-%M-%v.wav</B><DD>
|
|
Record in stereo from the default audio source. Create a new file
|
|
every hour. The files are placed in directories based on their start dates
|
|
and have names which include their start times and file numbers.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B>
|
|
<A HREF="/cgi-bin/man/man2html?1+alsamixer">alsamixer</A>(1),
|
|
<A HREF="/cgi-bin/man/man2html?1+amixer">amixer</A>(1)
|
|
</B>
|
|
<P>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>BUGS </H2>
|
|
|
|
Note that .aiff files are not currently supported.
|
|
<P>
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
<B>arecord</B> and <B>aplay</B> are by Jaroslav Kysela <<A HREF="mailto:perex@perex.cz">perex@perex.cz</A>>
|
|
This document is by Paul Winkler <<A HREF="mailto:zarmzarm@erols.com">zarmzarm@erols.com</A>>.
|
|
Updated for Alsa 0.9 by James Tappin <<A HREF="mailto:james@xena.uklinux.net">james@xena.uklinux.net</A>>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="45"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="46"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="47"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="48"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="49"><A HREF="#lbAF">SIGNALS</A><DD>
|
|
<DT id="50"><A HREF="#lbAG">EXAMPLES</A><DD>
|
|
<DT id="51"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="52"><A HREF="#lbAI">BUGS </A><DD>
|
|
<DT id="53"><A HREF="#lbAJ">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:06 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|