2012-02-11 16:52:23 -08:00
|
|
|
.TH AUDIO 1
|
2011-03-30 06:49:47 -07:00
|
|
|
.SH NAME
|
2012-03-07 22:25:14 -08:00
|
|
|
mp3dec, mp3enc, oggdec, oggenc, flacdec, wavdec \- decode and encode audio files
|
2011-03-30 06:49:47 -07:00
|
|
|
.SH SYNOPSIS
|
2012-02-11 11:32:05 -08:00
|
|
|
.B audio/mp3dec
|
|
|
|
[
|
|
|
|
.B -d
|
|
|
|
]
|
|
|
|
.br
|
2012-02-11 16:52:23 -08:00
|
|
|
.B audio/oggdec
|
|
|
|
.br
|
|
|
|
.B audio/flacdec
|
2012-03-07 22:25:14 -08:00
|
|
|
.br
|
|
|
|
.B audio/wavdec
|
2012-02-11 16:52:23 -08:00
|
|
|
.PP
|
|
|
|
.B audio/oggenc
|
|
|
|
.br
|
2012-01-22 14:30:34 -08:00
|
|
|
.B audio/mp3enc
|
2011-03-30 06:49:47 -07:00
|
|
|
[
|
|
|
|
.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"
|
|
|
|
]
|
2012-02-11 16:52:23 -08:00
|
|
|
.PP
|
2011-03-30 06:49:47 -07:00
|
|
|
.SH DESCRIPTION
|
2012-02-11 16:52:23 -08:00
|
|
|
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
|
2012-02-11 11:32:05 -08:00
|
|
|
.B -d
|
2012-02-11 16:52:23 -08:00
|
|
|
option enables debug output to standard error.
|
2012-03-07 22:25:14 -08:00
|
|
|
.I Oggdec,
|
2012-02-11 16:52:23 -08:00
|
|
|
.I flacdec
|
2012-03-07 22:25:14 -08:00
|
|
|
and
|
|
|
|
.I wavdec
|
2012-02-11 16:52:23 -08:00
|
|
|
are like
|
|
|
|
.I mp3dec
|
2012-03-07 22:25:14 -08:00
|
|
|
but decode OGG Vorbis, FLAC lossless audio and PCM Wave.
|
2012-02-11 11:32:05 -08:00
|
|
|
.PP
|
2012-02-11 16:52:23 -08:00
|
|
|
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
|
2011-03-30 06:49:47 -07:00
|
|
|
.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
|
|
|
|
.
|
2012-02-11 16:52:23 -08:00
|
|
|
.SH EXAMPLE
|
|
|
|
Plays back a
|
2012-02-11 11:32:05 -08:00
|
|
|
.L .mp3
|
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-11 16:52:23 -08:00
|
|
|
audio/mp3dec <foo.mp3 >/dev/audio
|
2012-02-11 11:32:05 -08:00
|
|
|
.EE
|
|
|
|
.LP
|
2011-03-30 06:49:47 -07:00
|
|
|
Encode a
|
|
|
|
.L .wav
|
2012-02-11 16:52:23 -08:00
|
|
|
file as highest-quality MP3.
|
2011-03-30 06:49:47 -07:00
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-11 16:52:23 -08:00
|
|
|
audio/mp3enc -q 0 -b 320
|
2011-03-30 06:49:47 -07:00
|
|
|
.EE
|
|
|
|
.LP
|
|
|
|
Create a fixed 128Kb/s MP3 file from a
|
|
|
|
.L .wav
|
2012-02-11 16:52:23 -08:00
|
|
|
file.
|
2011-03-30 06:49:47 -07:00
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-11 16:52:23 -08:00
|
|
|
audio/mp3enc -h <foo.wav >foo.mp3
|
2011-03-30 06:49:47 -07:00
|
|
|
.EE
|
|
|
|
.LP
|
2012-02-11 16:52:23 -08:00
|
|
|
Streaming from stereo 44.1KHz raw PCM data, encoding mono at 16KHz
|
2011-03-30 06:49:47 -07:00
|
|
|
(you may not need
|
|
|
|
.IR dd ):
|
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-11 16:52:23 -08:00
|
|
|
dd -conv swab | audio/mp3enc -a -r -m m --resample 16 -b 24
|
2011-03-30 06:49:47 -07:00
|
|
|
.EE
|
|
|
|
.SH SOURCE
|
2012-02-11 16:52:23 -08:00
|
|
|
.B /sys/src/cmd/audio
|
2012-02-11 11:32:05 -08:00
|
|
|
.SH "SEE ALSO"
|
2012-02-11 16:52:23 -08:00
|
|
|
.IR play (1),
|
2011-03-30 06:49:47 -07:00
|
|
|
.IR juke (7),
|
|
|
|
.IR playlistfs (7)
|
|
|
|
.br
|
2012-02-11 11:32:05 -08:00
|
|
|
.B http://www.underbit.com/products/mad/
|
|
|
|
.br
|
2012-02-11 16:52:23 -08:00
|
|
|
.B http://xiph.org/doc/
|
|
|
|
.br
|
|
|
|
.B http://flac.sourceforge.net/documentation.html
|
2011-03-30 06:49:47 -07:00
|
|
|
.SH BUGS
|
2012-02-11 16:52:23 -08:00
|
|
|
It's another GNU behemoth, lightly tamed.
|