ossrecord(1) | OSS User Commands | ossrecord(1) |
ossrecord - Open Sound System recording program.
ossrecord [-ORhlv] [-F cntname | ? ] [ -c channels ] [ -d devname ] [ -f fmtname | ? ] [ -g gain ] [ -i recsource | ? ] [ -m nfiles ] [ -r command ] [ -s rate ] [ -t maxsecs ] filename | - ...
The ossrecord program records audio in Microsoft RIFF (wav) format. It will record from any input that's currently set as the recording source by the ossxmix/ossmix mixer programs. With the -l option, you also get a level meter that will display VU levels in a character mode.
The filename parameter is name of the (.wav) file to be produced. Output can be sent to stdout by giving - as the file name.
The -r command line argument makes it possible to
execute a script or program after recording of the wave file is finished.
Below is a simple shell script that does MP3 encoding using lame.
#!/bin/sh
MP3NAME=$1.mp3
lame -m s -h --preset studio $WAVENAME $MP3NAME
exit 0
Another example script for ossrecord is a simple CGI script for live MP3 streaming (from /dev/dsp).
#!/bin/sh
echo Content-Type: audio/mp3
echo
ossrecord -S -b16 -s48 - | lame -m j - -
exit 0
The ossrecord executable is the same as the ossplay executable. Behaviour is decided by the name used to invoke the program.
Some file formats allocate only 32 bits to record the file length, which may prevent some programs from reading a too large file properly. If a recording may pass the 4GB limit (a bit more then 6 hours and 10 minutes of sound assuming [48Khz/16bit/stereo] quality), it's best to have ossrecord use the AU or RAW containers (via -F switch) which do not have this restriction.
ossplay(1), ossmix(1), ossxmix(1)
/usr/bin/ossrecord
4Front Technologies
11 February 2015 |