ossrecord(1)
๐ ossrecord(1) โ OSS User Commands ๐
okay bestie, gather round, because this is the Open Sound System recording program and it is literally about to change your life. it's ossrecord, it's part of the OSS user commands squad, and it's here to catch every single sound your machine can hear. ๐
โจ SYNOPSIS โจ
ossrecord [-ORhlv] [-F cntname | ? ] [ -c channels ] [ -d devname ]
[ -f fmtname | ? ] [ -g gain ] [ -i recsource | ? ] [ -m nfiles ]
[ -r command ] [ -s rate ] [ -t maxsecs ] filename | - ...
๐ฆ DESCRIPTION ๐ฆ
so ossrecord records audio in Microsoft RIFF (wav) format. that's the vibe. ๐
it will record from any input that's currently set as the recording source by the ossxmix/ossmix mixer programs. and if you slap the -l option on there, you also get a level meter that displays VU levels in character mode. yes, character mode. we love a retro moment. ๐
the filename parameter is the name of the (.wav) file that's gonna be produced. and listen โ if you want your output to go to stdout instead, just give - as the file name. iconic behavior tbh.
๐ OPTIONS ๐
-s<rate>โ pick the recording rate for raw PCM audio (eg-s48000). rate selection? slay.-c<channels>โ pick how many channels you want: 1=mono, 2=stereo, 4, 6, 8, etc. the more the merrier fr.-d<devname>โ select <devname> as the device (eg-d/dev/dsp2). choose your fighter. ๐ฎ-f<fmt>โ select the input sample format (eg-fS32_LEor-fMU_LAW).-f?โ prints the list of supported format names. it's giving "let me show you the menu". ๐-F<cnt>โ select the container format (egWAVorAU). default isWAV. no cap.-F?โ prints the list of supported container formats.-Rโ open the audio device in raw mode to disable virtual mixing and sample rate/format conversions. you can use this when recording from a digital source (S/PDIF input). โจ-vโ verbose output. it's giving narrator energy.-lโ display level meters (character based). ๐-i<recsrc|?>โ select the recording source, or display available recording sources if?is supplied. e.g.ossrecord -i?may display:vol line (currently selected) mic cd aux1 phone mono video-m<nfiles>โ repeat the recording operation <nfiles> times. important bestie: the filename argument must have%d(or%02d) somewhere in the file to guarantee unique filenames. if no%dis given then subsequent recordings will overwrite the previous one(s). ๐ญ this option is useful only with loopback audio devices or if the-toption is used.-r<command>โ this option launches the <command> in background after recording the file has completed. the name of the recorded file will be given as the (only) command line argument. when the-moption is used, the script will run in parallel while recording the next file. see the COMMAND SCRIPT section (below) for more info. multitasking queen ๐-g<gain>โ amplify recorded samples by percentage given as argument.100(default) means normal signal level,200means double level. only supported in 16 and 32 bit modes. turn it up!! ๐-t<maxsecs>โ do not record more than <maxsecs> seconds in a single recording operation. we're setting boundaries this year. ๐ซถ-L<level>โ set the recording level to <level>.-Oโ do not allowossrecordto overwrite the output file. protective king behavior. ๐ก๏ธ-hโ display usage instructions.
๐ COMMAND SCRIPT ๐
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
WAVENAME=$1
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
๐ธ NOTES ๐ธ
the ossrecord executable is the same as the ossplay executable. behaviour is decided by the name used to invoke the program. one binary, two personalities โ main character energy fr. ๐
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 the -F switch) which do not have this restriction. ๐จ
bestie please read that again. 4GB. six hours and change. if you're recording a marathon, switch containers. i'm not kidding. ๐
๐ SEE ALSO ๐
ossplay(1), ossmix(1), ossxmix(1)
๐ FILES ๐
/usr/bin/ossrecord
โญ AUTHOR โญ
4Front Technologies
and that's the whole thing, bestie โ page written 11 February 2015, brought to you by the OSS User Commands era. go record something iconic. ๐โจ๐ฆ
๐ฆ where this page comes from
- ubuntu noble: oss4-base 4.2-build2020-1ubuntu3
- ubuntu noble: oss4-base 4.2-build2020-1ubuntu3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms