AUDIO(1) AUDIO(1)
NAME
mp3dec, mp3enc, oggdec, oggenc, flacdec, sundec, wavdec,
pcmconv - decode and encode audio files
SYNOPSIS
audio/mp3dec [ -d ]
audio/oggdec
audio/flacdec
audio/wavdec
audio/sundec
audio/oggenc
audio/mp3enc [ -hprv ] [ -b bitrate ] [ -B bitrate ] [ -m
mode ] [ -q q ] [ -s sfreq ] [ -V q ] [ long or silly
options ]
audio/pcmconv [ -i fmt ] [ -o fmt ] [ -l length ]
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.
Mp3dec decodes MPEG audio (layer 1, 2 and 3). The -d option
enables debug output to standard error. Oggdec, flacdec,
sunwdec and wavdec are like mp3dec but decode OGG Vorbis,
FLAC lossless audio, Sun audio and RIFF wave.
The encoders read PCM on standard input and produce com-
pressed audio on standard output.
Oggenc and mp3enc produce OGG Vorbis and MP3 audio. For
mp3enc, the MP3 file will use `constant bit-rate' (CBR)
encoding by default, but that can be changed via --abr
(average bitrate desired, ABR) or -v (variable bitrate,
VBR).
Options
-b set minimum allowed bitrate in Kb/s for VBR, default
32Kb/s. For CBR, set the exact bitrate in Kb/s, which
defaults to 128Kb/s.
-B set maximum allowed bitrate in Kb/s for VBR, default
256Kb/s.
-h same as `-q 2'.
-m mode may be (s)tereo, (j)oint, (f)orce or (m)ono
(default j). force forces mid/side stereo on all
frames.
-p add CRC error protection (adds an additional 16 bits
per frame to the stream). This seems to break
Page 1 Plan 9 (printed 5/24/13)
AUDIO(1) AUDIO(1)
playback.
-q sets output quality to q (see -V).
-r input is raw pcm
-s set sampling frequency of input file (in KHz) to sfreq,
default is 44.1.
-v use variable bitrate (VBR) encoding
-V set quality setting for VBR to q. Default q is 4; 0
produces highest-quality and largest files, and 9 pro-
duces lowest-quality and smallest files.
Long options
--abr bitrate sets average bitrate desired in Kb/s,
instead of setting quality, and generates
ABR encoding.
--resample sfreq set sampling frequency of output file (in
KHz) to sfreq, default is input sfreq.
--mp3input input is an MP3 file
Silly options
-f same as `-q 7'. Such a deal.
-o mark as non-original (i.e. do not set the original
bit)
-c mark as copyright
-k disable sfb=21 cutoff
-e emp de-emphasis n/5/c (default n)
-d allow channels to have different blocktypes
-t disable Xing VBR informational tag
-a autoconvert from stereo to mono file for mono
encoding
-x force byte-swapping of input (see dd(1) instead)
-S don't print progress report, VBR histograms
--athonly only use the ATH for masking
--nohist disable VBR histogram display
--voice experimental voice mode
Pcmconv is a helper program used to convert various PCM sam-
ple formats. The -i and -o options specify the input and
output format fmt of the conversion. Fmt is a concatinated
string of the following parts:
s# sample format is little-endian signed integer where #
specifies the number of bits
u# unsigned little-endian integer format
S# singed big-endian integer format
U# unsigned big-endian integer format
f# floating point format where # has to be 32 or 64 for
single- or double-precisition
Page 2 Plan 9 (printed 5/24/13)
AUDIO(1) AUDIO(1)
a8 8-bit a-law format
µ8 8-bit µ-law format
c# specifies the number of channels
r# gives the samplerate in Hz
The program reads samples from standard input converting the
data and writes the result to standard output until it
reached end of file or, if -l was given, a number of length
bytes have been consumed from input.
EXAMPLE
Play back an `.mp3'
audio/mp3dec <foo.mp3 >/dev/audio
Encode a `.wav' file as highest-quality MP3.
audio/mp3enc -q 0 -b 320
Create a fixed 128Kb/s MP3 file from a `.wav' file.
audio/mp3enc -h <foo.wav >foo.mp3
Streaming from stereo 44.1KHz raw PCM data, encoding mono at
16KHz (you may not need dd):
dd -conv swab | audio/mp3enc -a -r -m m --resample 16 -b 24
SOURCE
/sys/src/cmd/audio
SEE ALSO
play(1), juke(7), playlistfs(7)
http://www.underbit.com/products/mad/
http://xiph.org/doc/
http://flac.sourceforge.net/documentation.html
BUGS
It's another GNU behemoth, lightly tamed.
Page 3 Plan 9 (printed 5/24/13)