ossrecord(1)

๐Ÿ“ฆ
version 4.2-build2020 ยท 3 versions
, in ubuntu noble

๐Ÿ’– 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_LE or -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 (eg WAV or AU). default is WAV. 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 %d is given then subsequent recordings will overwrite the previous one(s). ๐Ÿ˜ญ this option is useful only with loopback audio devices or if the -t option 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 -m option 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, 200 means 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 allow ossrecord to 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