From 0388ad23395228fc0772343dbe7a294ab6c9d679 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 12 Feb 2012 01:52:23 +0100 Subject: add audio(1) --- sys/man/1/audio | 240 ++++++++++++++++++++++++++++++++++++++++++++++ sys/man/1/flacdec | 282 ------------------------------------------------------ sys/man/1/play | 6 +- 3 files changed, 244 insertions(+), 284 deletions(-) create mode 100644 sys/man/1/audio delete mode 100644 sys/man/1/flacdec diff --git a/sys/man/1/audio b/sys/man/1/audio new file mode 100644 index 000000000..c941fa5f0 --- /dev/null +++ b/sys/man/1/audio @@ -0,0 +1,240 @@ +.TH AUDIO 1 +.SH NAME +mp3dec, mp3enc, oggdec, oggenc, flacdec \- decode and encode audio files +.SH SYNOPSIS +.B audio/mp3dec +[ +.B -d +] +.br +.B audio/oggdec +.br +.B audio/flacdec +.PP +.B audio/oggenc +.br +.B audio/mp3enc +[ +.B -hprv +] [ +.B -b +.I bitrate +] [ +.B -B +.I bitrate +] [ +.B -m +.I mode +] [ +.B -q +q ] [ +.B -s +.I sfreq +] [ +.B -V +.I q +] [ +.I "long or silly options" +] +.PP +.SH DESCRIPTION +These programs decode and encode various audio formats from and to +16-bit stereo PCM (little endian). The decoders read the compressed +audio data from standard input and produce PCM on standard output at +a sampling frequency of 44.1KHz. +.PP +.I Mp3dec +decodes MPEG audio (layer 1, 2 and 3). The +.B -d +option enables debug output to standard error. +.I Oggdec +and +.I flacdec +are like +.I mp3dec +but decode OGG Vorbis and FLAC lossless audio. +.PP +The encoders read PCM on standard input and produce compressed audio +on standard output. +.I Oggenc +and +.I mp3enc +produce OGG Vorbis and MP3 audio. For +.I mp3enc, +the MP3 file will use `constant bit-rate' (CBR) encoding by default, +but that can be changed via +.B --abr +(average bitrate desired, ABR) +or +.BR -v +(variable bitrate, VBR). +.SS Options +.TF "\fB-b \fP" +.TP +.B -b +set minimum allowed +.I bitrate +in Kb/s for VBR, default 32Kb/s. +For CBR, +set the exact bitrate in Kb/s, which defaults to 128Kb/s. +.TP +.B -B +set maximum allowed +.I bitrate +in Kb/s for VBR, default 256Kb/s. +.TP +.BI -h +same as +.LR "-q 2" . +.TP +.B -m +.I mode +may be +(s)tereo, +(j)oint, +(f)orce +or +(m)ono +(default j). +.B force +forces mid/side stereo on all frames. +.TP +.B -p +add CRC error protection (adds an additional 16 bits per frame to the stream). +This seems to break playback. +.TP +.B -q +sets output quality to +.I q +(see +.BR -V ). +.TP +.B -r +input is raw pcm +.TP +.B -s +set sampling frequency of input file (in KHz) to +.IR sfreq , +default is 44.1. +.TP +.B -v +use variable bitrate (VBR) encoding +.TP +.B -V +set quality setting for VBR to +.IR q . +Default +.I q +is 4; +0 produces highest-quality and largest files, and +9 produces lowest-quality and smallest files. +.SS Long options +.TF "\fB--resample sfreq \fP" +.TP +.BI --abr " bitrate" +sets average +.I bitrate +desired in Kb/s, instead of setting quality, +and generates ABR encoding. +.TP +.BI --resample " sfreq" +set sampling frequency of output file (in KHz) to +.IR sfreq , +default is input sfreq. +.TP +.BI --mp3input +.I input +is an MP3 file +. +.SS Silly options +.TF --nohist +.TP +.BI -f +same as +.LR "-q 7" . +Such a deal. +.TP +.BI -o +mark as non-original (i.e. do not set the original bit) +.TP +.BI -c +mark as copyright +.TP +.BI -k +disable sfb=21 cutoff +.TP +.BI -e " emp" +de-emphasis n/5/c +(default n) +.TP +.BI -d +allow channels to have different blocktypes +.TP +.BI -t +disable Xing VBR informational tag +.TP +.BI -a +autoconvert from stereo to mono file for mono encoding +.TP +.BI -x +force byte-swapping of input (see +.IR dd (1) +instead) +.TP +.BI -S +don't print progress report, VBR histograms +.TP +.BI --athonly +only use the ATH for masking +.TP +.BI --nohist +disable VBR histogram display +.TP +.BI --voice +experimental voice mode +. +.SH EXAMPLE +Plays back a +.L .mp3 +.IP +.EX +audio/mp3dec /dev/audio +.EE +.LP +Encode a +.L .wav +file as highest-quality MP3. +.IP +.EX +audio/mp3enc -q 0 -b 320 +.EE +.LP +Create a fixed 128Kb/s MP3 file from a +.L .wav +file. +.IP +.EX +audio/mp3enc -h foo.mp3 +.EE +.LP +Streaming from stereo 44.1KHz raw PCM data, encoding mono at 16KHz +(you may not need +.IR dd ): +.IP +.EX +dd -conv swab | audio/mp3enc -a -r -m m --resample 16 -b 24 +.EE +.SH SOURCE +.B /sys/src/cmd/audio +.SH "SEE ALSO" +.IR play (1), +.IR juke (7), +.IR playlistfs (7) +.br +.B http://www.underbit.com/products/mad/ +.br +.B http://xiph.org/doc/ +.br +.B http://flac.sourceforge.net/documentation.html +.SH BUGS +It's another GNU behemoth, lightly tamed. diff --git a/sys/man/1/flacdec b/sys/man/1/flacdec deleted file mode 100644 index 09f500564..000000000 --- a/sys/man/1/flacdec +++ /dev/null @@ -1,282 +0,0 @@ -.TH FLACDEC 1 -.SH NAME -flacdec \- decode FLAC audio files -.br -mp3dec \- decode MPEG layer 3 audio files -.br -mp3enc \- encode MPEG layer 3 audio files -.br -oggdec \- decode Ogg Vorbis audio files -.br -oggenc \- encode Ogg Vorbis audio files -.SH SYNOPSIS -.B audio/flacdec -.br -.B audio/mp3dec -[ -.B -d -] -.br -.in +0.5i -.ti -0.5i -.B audio/mp3enc -[ -.B -hprv -] [ -.B -b -.I bitrate -] [ -.B -B -.I bitrate -] [ -.B -m -.I mode -] [ -.B -q -q ] [ -.B -s -.I sfreq -] [ -.B -V -.I q -] [ -.I "long or silly options" -] -.in -0.5i -.B audio/oggdec -.br -.B audio/oggenc -.SH DESCRIPTION -.I Flacdec, mp3dec and oggdec -decode audio from standard input, -writing 16-bit stereo linear PCM sample data to -standard output. The -.B -d -option enables debug prints to standard error. -.PP -.I Mp3enc -compresses audio on standard input, -normally PCM-encoded, -and produces MP3-encoded audio on standard output. -By default, the MP3 file will use `constant bit-rate' (CBR) -encoding, but that can be changed via -.B --abr -(average bitrate desired, ABR) -or -.BR -v -(variable bitrate, VBR). -.PP -.I Oggenc -reads 44100Hz 16 bit LSB stereo data from standard input, and writes -encoded -.I 128 kbit/s -variable bit rate -.I ogg vorbis -stream to standard output. -.SH MP3ENC OPTIONS -.SS Options -.TF "\fB-b \fP" -.TP -.B -b -set minimum allowed -.I bitrate -in Kb/s for VBR, default 32Kb/s. -For CBR, -set the exact bitrate in Kb/s, which defaults to 128Kb/s. -.TP -.B -B -set maximum allowed -.I bitrate -in Kb/s for VBR, default 256Kb/s. -.TP -.BI -h -same as -.LR "-q 2" . -.TP -.B -m -.I mode -may be -(s)tereo, -(j)oint, -(f)orce -or -(m)ono -(default j). -.B force -forces mid/side stereo on all frames. -.TP -.B -p -add CRC error protection (adds an additional 16 bits per frame to the stream). -This seems to break playback. -.TP -.B -q -sets output quality to -.I q -(see -.BR -V ). -.TP -.B -r -input is raw pcm -.TP -.B -s -set sampling frequency of input file (in KHz) to -.IR sfreq , -default is 44.1. -.TP -.B -v -use variable bitrate (VBR) encoding -.TP -.B -V -set quality setting for VBR to -.IR q . -Default -.I q -is 4; -0 produces highest-quality and largest files, and -9 produces lowest-quality and smallest files. -.SS Long options -.TF "\fB--resample sfreq \fP" -.TP -.BI --abr " bitrate" -sets average -.I bitrate -desired in Kb/s, instead of setting quality, -and generates ABR encoding. -.TP -.BI --resample " sfreq" -set sampling frequency of output file (in KHz) to -.IR sfreq , -default is input sfreq. -.TP -.BI --mp3input -.I input -is an MP3 file -. -.SS Silly options -.TF --nohist -.TP -.BI -f -same as -.LR "-q 7" . -Such a deal. -.TP -.BI -o -mark as non-original (i.e. do not set the original bit) -.TP -.BI -c -mark as copyright -.TP -.BI -k -disable sfb=21 cutoff -.TP -.BI -e " emp" -de-emphasis n/5/c -(default n) -.TP -.BI -d -allow channels to have different blocktypes -.TP -.BI -t -disable Xing VBR informational tag -.TP -.BI -a -autoconvert from stereo to mono file for mono encoding -.TP -.BI -x -force byte-swapping of input (see -.IR dd (1) -instead) -.TP -.BI -S -don't print progress report, VBR histograms -.TP -.BI --athonly -only use the ATH for masking -.TP -.BI --nohist -disable VBR histogram display -.TP -.BI --voice -experimental voice mode -. -.SH EXAMPLES -Play a -.L .flac -file: -.IP -.EX -audio/flacdec < foo.flac >/dev/audio -.EE -.LP -Play an -.L .mp3 -file: -.IP -.EX -games/mp3dec < foo.mp3 >/dev/audio -.EE -.LP -Encode a -.L .wav -file as highest-quality MP3: -.IP -.EX -games/mp3enc -q 0 -b 320 foo.mp3 -.EE -.LP -Create a fixed 128Kb/s MP3 file from a -.L .wav -file: -.IP -.EX -games/mp3enc -h foo.mp3 -.EE -.LP -Stream from stereo 44.1KHz raw PCM data, encoding mono at 16KHz -(you may not need -.IR dd ): -.IP -.EX -dd -conv swab | games/mp3enc -a -r -m m --resample 16 -b 24 >foo.mp3 -.EE -.LP -Play an -.L .ogg -file: -.IP -.EX -audio/oggdec < foo.ogg > /dev/audio -.EE -.LP -Encode a -.L .wav -file as an -.L .ogg -file: -.IP -.EX -audio/oggenc < foo.wav > foo.ogg -.EE -.SH SOURCE -.B /sys/src/cmd/audio/mp3dec -.br -.B /sys/src/cmd/audio/mp3enc -.br -.B /sys/src/cmd/audio/oggdec -.br -.B /sys/src/cmd/audio/oggenc -.SH "SEE ALSO" -.IR dd (1), -.IR audio (3), -.IR cdfs (4), -.IR juke (7), -.IR playlistfs (7) -.br -.B http://www.underbit.com/products/mad/ -.br -.B http://www.sulaco.org/mp3 -.SH BUGS -GNU behemoths, lightly tamed. Quality is much better than encoders -based on the ISO routines, but still not as good as the FhG encoder. -.PP -There are zillions of undocumented options. diff --git a/sys/man/1/play b/sys/man/1/play index a279a785f..5499198e7 100644 --- a/sys/man/1/play +++ b/sys/man/1/play @@ -45,6 +45,9 @@ Mpeg audio. .TP .B ogg Ogg vorbis. +.TP +.B flac +FLAC lossless audio. .PP By default, raw audio data is written to .B /dev/audio @@ -54,6 +57,5 @@ option. .SH SOURCE .B /rc/bin/play .SH "SEE ALSO" -.IR mp3dec (1), -.IR oggdec (1), +.IR audio (1), .IR hget (1) -- cgit v1.2.3