2012-02-12 00:52:23 +00:00
|
|
|
.TH AUDIO 1
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH NAME
|
2021-01-11 14:45:12 +00:00
|
|
|
mp3dec, mp3enc, oggdec, oggenc, flacdec, flacenc, sundec, wavdec, pcmconv, mixfs \- decode and encode audio files
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH SYNOPSIS
|
2012-02-11 19:32:05 +00:00
|
|
|
.B audio/mp3dec
|
|
|
|
[
|
2020-08-12 08:43:46 +00:00
|
|
|
.B -s
|
|
|
|
.I seconds
|
|
|
|
] [
|
2012-02-11 19:32:05 +00:00
|
|
|
.B -d
|
|
|
|
]
|
|
|
|
.br
|
2012-02-12 00:52:23 +00:00
|
|
|
.B audio/oggdec
|
2020-08-11 15:27:11 +00:00
|
|
|
[
|
|
|
|
.B -s
|
|
|
|
.I seconds
|
|
|
|
]
|
2012-02-12 00:52:23 +00:00
|
|
|
.br
|
|
|
|
.B audio/flacdec
|
2020-08-11 15:27:11 +00:00
|
|
|
[
|
|
|
|
.B -s
|
|
|
|
.I seconds
|
|
|
|
]
|
2012-03-08 06:25:14 +00:00
|
|
|
.br
|
|
|
|
.B audio/wavdec
|
2020-11-02 10:46:50 +00:00
|
|
|
[
|
|
|
|
.B -s
|
|
|
|
.I seconds
|
|
|
|
]
|
2012-12-08 08:18:44 +00:00
|
|
|
.br
|
2012-12-14 03:38:45 +00:00
|
|
|
.B audio/sundec
|
2012-02-12 00:52:23 +00:00
|
|
|
.PP
|
|
|
|
.B audio/oggenc
|
|
|
|
.br
|
2012-01-22 22:30:34 +00:00
|
|
|
.B audio/mp3enc
|
2011-03-30 13:49:47 +00: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"
|
|
|
|
]
|
2021-01-11 14:45:12 +00:00
|
|
|
.br
|
|
|
|
.B audio/flacenc
|
|
|
|
[
|
|
|
|
.B -b
|
|
|
|
.I bitspersample
|
|
|
|
] [
|
|
|
|
.B -c
|
|
|
|
.I channels
|
|
|
|
] [
|
|
|
|
.B -l
|
|
|
|
.I compresslevel
|
|
|
|
] [
|
|
|
|
.B -s
|
|
|
|
.I sfreq
|
|
|
|
] [
|
|
|
|
.B -P
|
|
|
|
.I padding
|
|
|
|
] [
|
|
|
|
.B -T
|
|
|
|
.I field=value
|
|
|
|
]
|
2012-02-12 00:52:23 +00:00
|
|
|
.PP
|
2012-12-08 07:26:50 +00:00
|
|
|
.B audio/pcmconv
|
|
|
|
[
|
|
|
|
.B -i
|
|
|
|
.I fmt
|
|
|
|
] [
|
|
|
|
.B -o
|
|
|
|
.I fmt
|
|
|
|
] [
|
|
|
|
.B -l
|
|
|
|
.I length
|
|
|
|
]
|
|
|
|
.PP
|
2013-12-26 20:04:25 +00:00
|
|
|
.B audio/mixfs
|
|
|
|
[
|
|
|
|
.B -D
|
|
|
|
] [
|
|
|
|
.B -s
|
|
|
|
.I srvname
|
|
|
|
] [
|
|
|
|
.B -m
|
|
|
|
.I mtpt
|
|
|
|
]
|
|
|
|
.PP
|
2011-03-30 13:49:47 +00:00
|
|
|
.SH DESCRIPTION
|
2012-02-12 00:52:23 +00: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 19:32:05 +00:00
|
|
|
.B -d
|
2012-02-12 00:52:23 +00:00
|
|
|
option enables debug output to standard error.
|
2012-03-08 06:25:14 +00:00
|
|
|
.I Oggdec,
|
2012-12-08 08:18:44 +00:00
|
|
|
.I flacdec,
|
2012-12-14 03:38:45 +00:00
|
|
|
.I sunwdec
|
2012-03-08 06:25:14 +00:00
|
|
|
and
|
|
|
|
.I wavdec
|
2012-02-12 00:52:23 +00:00
|
|
|
are like
|
|
|
|
.I mp3dec
|
2012-12-14 03:38:45 +00:00
|
|
|
but decode OGG Vorbis, FLAC lossless audio, Sun audio and RIFF wave.
|
2020-08-11 15:27:11 +00:00
|
|
|
.SS Decoding options
|
|
|
|
.TF "\fB-s seconds \fP"
|
|
|
|
.TP
|
|
|
|
.BI -s " seconds"
|
|
|
|
seek to a specific position in seconds before decoding.
|
|
|
|
.SS
|
2012-02-11 19:32:05 +00:00
|
|
|
.PP
|
2012-02-12 00:52:23 +00:00
|
|
|
The encoders read PCM on standard input and produce compressed audio
|
|
|
|
on standard output.
|
2012-12-08 07:26:50 +00:00
|
|
|
.PP
|
2021-01-11 14:45:12 +00:00
|
|
|
.I Flacenc,
|
|
|
|
.I oggenc
|
2012-02-12 00:52:23 +00:00
|
|
|
and
|
|
|
|
.I mp3enc
|
2021-01-11 14:45:12 +00:00
|
|
|
produce FLAC, OGG Vorbis and MP3 audio. For
|
2012-02-12 00:52:23 +00:00
|
|
|
.I mp3enc,
|
|
|
|
the MP3 file will use `constant bit-rate' (CBR) encoding by default,
|
|
|
|
but that can be changed via
|
2011-03-30 13:49:47 +00:00
|
|
|
.B --abr
|
|
|
|
(average bitrate desired, ABR)
|
|
|
|
or
|
|
|
|
.BR -v
|
|
|
|
(variable bitrate, VBR).
|
2015-05-01 18:03:29 +00:00
|
|
|
.PP
|
2021-01-11 14:45:12 +00:00
|
|
|
.I Flacenc
|
|
|
|
and
|
|
|
|
.I oggenc
|
|
|
|
accept raw PCM in the same byte order as
|
2015-05-01 18:03:29 +00:00
|
|
|
.B /dev/audio
|
|
|
|
(little-endian),
|
2021-01-11 14:45:12 +00:00
|
|
|
while
|
2015-05-01 18:03:29 +00:00
|
|
|
.I mp3enc -r
|
|
|
|
expects big-endian.
|
2020-08-11 15:27:11 +00:00
|
|
|
.SS Encoding options
|
2011-03-30 13:49:47 +00:00
|
|
|
.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
|
2013-01-09 06:53:47 +00:00
|
|
|
.BI --mp3input " input"
|
2011-03-30 13:49:47 +00:00
|
|
|
is an MP3 file
|
|
|
|
.
|
|
|
|
.SS Silly options
|
|
|
|
.TF --nohist
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -f
|
2011-03-30 13:49:47 +00:00
|
|
|
same as
|
|
|
|
.LR "-q 7" .
|
|
|
|
Such a deal.
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -o
|
2011-03-30 13:49:47 +00:00
|
|
|
mark as non-original (i.e. do not set the original bit)
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -c
|
2011-03-30 13:49:47 +00:00
|
|
|
mark as copyright
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -k
|
2011-03-30 13:49:47 +00:00
|
|
|
disable sfb=21 cutoff
|
|
|
|
.TP
|
|
|
|
.BI -e " emp"
|
|
|
|
de-emphasis n/5/c
|
|
|
|
(default n)
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -d
|
2011-03-30 13:49:47 +00:00
|
|
|
allow channels to have different blocktypes
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -t
|
2011-03-30 13:49:47 +00:00
|
|
|
disable Xing VBR informational tag
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -a
|
2011-03-30 13:49:47 +00:00
|
|
|
autoconvert from stereo to mono file for mono encoding
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -x
|
2011-03-30 13:49:47 +00:00
|
|
|
force byte-swapping of input (see
|
|
|
|
.IR dd (1)
|
|
|
|
instead)
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B -S
|
2011-03-30 13:49:47 +00:00
|
|
|
don't print progress report, VBR histograms
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B --athonly
|
2011-03-30 13:49:47 +00:00
|
|
|
only use the ATH for masking
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B --nohist
|
2011-03-30 13:49:47 +00:00
|
|
|
disable VBR histogram display
|
|
|
|
.TP
|
2013-01-09 06:53:47 +00:00
|
|
|
.B --voice
|
2011-03-30 13:49:47 +00:00
|
|
|
experimental voice mode
|
2013-01-09 06:53:47 +00:00
|
|
|
.SS
|
2012-12-08 07:26:50 +00:00
|
|
|
.I Pcmconv
|
|
|
|
is a helper program used to convert various PCM sample formats. The
|
|
|
|
.B -i
|
|
|
|
and
|
|
|
|
.B -o
|
|
|
|
options specify the input and output format
|
|
|
|
.I fmt
|
|
|
|
of the conversion.
|
|
|
|
.I Fmt
|
2013-08-23 15:27:30 +00:00
|
|
|
is a concatenated string of the following parts:
|
2012-12-08 07:26:50 +00:00
|
|
|
.TP
|
|
|
|
.BI s #
|
2012-12-14 03:38:45 +00:00
|
|
|
sample format is little-endian signed integer where
|
2012-12-08 07:26:50 +00:00
|
|
|
.I #
|
|
|
|
specifies the number of bits
|
|
|
|
.TP
|
|
|
|
.BI u #
|
2012-12-14 03:38:45 +00:00
|
|
|
unsigned little-endian integer format
|
|
|
|
.TP
|
|
|
|
.BI S #
|
2021-03-13 08:47:48 +00:00
|
|
|
signed big-endian integer format
|
2012-12-14 03:38:45 +00:00
|
|
|
.TP
|
|
|
|
.BI U #
|
|
|
|
unsigned big-endian integer format
|
2012-12-08 07:26:50 +00:00
|
|
|
.TP
|
|
|
|
.BI f #
|
|
|
|
floating point format where
|
|
|
|
.I #
|
2013-08-23 15:27:30 +00:00
|
|
|
has to be 32 or 64 for single- or double-precision
|
2012-12-14 03:38:45 +00:00
|
|
|
.TP
|
|
|
|
.B a8
|
|
|
|
8-bit a-law format
|
|
|
|
.TP
|
|
|
|
.B µ8
|
|
|
|
8-bit µ-law format
|
2012-12-08 07:26:50 +00:00
|
|
|
.TP
|
|
|
|
.BI c #
|
|
|
|
specifies the number of channels
|
|
|
|
.TP
|
|
|
|
.BI r #
|
|
|
|
gives the samplerate in Hz
|
|
|
|
.PP
|
|
|
|
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
|
|
|
|
.B -l
|
|
|
|
was given, a number of
|
|
|
|
.I length
|
|
|
|
bytes have been consumed from input.
|
2013-12-26 20:04:25 +00:00
|
|
|
.PP
|
|
|
|
.I Mixfs
|
|
|
|
is a fileserver serving a single
|
|
|
|
.B audio
|
2013-12-26 21:06:37 +00:00
|
|
|
file which allows simultaneous playback of audio streams. When
|
2013-12-26 20:04:25 +00:00
|
|
|
run, it binds over
|
|
|
|
.B /dev/audio
|
2013-12-26 21:06:37 +00:00
|
|
|
and mixes the audio samples that are written to it.
|
2013-12-26 20:04:25 +00:00
|
|
|
A service name
|
|
|
|
.I srvname
|
|
|
|
can be given with the
|
|
|
|
.B -s
|
|
|
|
option which gets posted to
|
|
|
|
.BR /srv .
|
|
|
|
By default,
|
|
|
|
.I mixfs
|
|
|
|
mounts itself on
|
|
|
|
.B /mnt/mix
|
|
|
|
and then binds
|
|
|
|
.B /mnt/mix/audio
|
|
|
|
over
|
|
|
|
.BR /dev .
|
|
|
|
A alternative mountpoint
|
|
|
|
.I mtpt
|
|
|
|
can be specified with the
|
|
|
|
.B -m
|
|
|
|
option.
|
|
|
|
The
|
|
|
|
.B -D
|
|
|
|
option causes
|
|
|
|
.B 9p
|
|
|
|
debug messages to be written to file-descriptor 2.
|
2012-02-12 00:52:23 +00:00
|
|
|
.SH EXAMPLE
|
2012-07-09 00:58:21 +00:00
|
|
|
Play back an
|
2012-02-11 19:32:05 +00:00
|
|
|
.L .mp3
|
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-12 00:52:23 +00:00
|
|
|
audio/mp3dec <foo.mp3 >/dev/audio
|
2012-02-11 19:32:05 +00:00
|
|
|
.EE
|
|
|
|
.LP
|
2011-03-30 13:49:47 +00:00
|
|
|
Encode a
|
|
|
|
.L .wav
|
2012-02-12 00:52:23 +00:00
|
|
|
file as highest-quality MP3.
|
2011-03-30 13:49:47 +00:00
|
|
|
.IP
|
|
|
|
.EX
|
2015-05-01 16:05:30 +00:00
|
|
|
audio/mp3enc -q 0 -b 320 <foo.wav >foo.mp3
|
2011-03-30 13:49:47 +00:00
|
|
|
.EE
|
|
|
|
.LP
|
|
|
|
Create a fixed 128Kb/s MP3 file from a
|
|
|
|
.L .wav
|
2012-02-12 00:52:23 +00:00
|
|
|
file.
|
2011-03-30 13:49:47 +00:00
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-12 00:52:23 +00:00
|
|
|
audio/mp3enc -h <foo.wav >foo.mp3
|
2011-03-30 13:49:47 +00:00
|
|
|
.EE
|
|
|
|
.LP
|
2012-02-12 00:52:23 +00:00
|
|
|
Streaming from stereo 44.1KHz raw PCM data, encoding mono at 16KHz
|
2011-03-30 13:49:47 +00:00
|
|
|
(you may not need
|
|
|
|
.IR dd ):
|
|
|
|
.IP
|
|
|
|
.EX
|
2012-02-12 00:52:23 +00:00
|
|
|
dd -conv swab | audio/mp3enc -a -r -m m --resample 16 -b 24
|
2011-03-30 13:49:47 +00:00
|
|
|
.EE
|
|
|
|
.SH SOURCE
|
2012-02-12 00:52:23 +00:00
|
|
|
.B /sys/src/cmd/audio
|
2012-02-11 19:32:05 +00:00
|
|
|
.SH "SEE ALSO"
|
2012-02-12 00:52:23 +00:00
|
|
|
.IR play (1),
|
2021-08-20 04:07:37 +00:00
|
|
|
.IR zuke (1)
|
2011-03-30 13:49:47 +00:00
|
|
|
.br
|
2012-02-11 19:32:05 +00:00
|
|
|
.B http://www.underbit.com/products/mad/
|
|
|
|
.br
|
2012-02-12 00:52:23 +00:00
|
|
|
.B http://xiph.org/doc/
|
|
|
|
.br
|
|
|
|
.B http://flac.sourceforge.net/documentation.html
|
2013-12-26 21:06:37 +00:00
|
|
|
.SH HISTORY
|
2013-12-26 21:22:23 +00:00
|
|
|
.I Pcmconv
|
|
|
|
first appeared in 9front (December, 2012).
|
2013-12-26 21:06:37 +00:00
|
|
|
.I Mixfs
|
|
|
|
first appeared in 9front (December, 2013).
|
2021-01-11 14:45:12 +00:00
|
|
|
.I Flacenc
|
2021-01-12 08:24:10 +00:00
|
|
|
first appeared in 9front (January, 2021).
|