NAME
mp3dec, mp3enc, oggdec, oggenc, flacdec, flacenc, sundec, wavdec,
pcmconv, mixfs – decode and encode audio files |
SYNOPSIS
audio/mp3dec [ –s seconds ] [ –d ] audio/oggdec [ –s seconds ] audio/flacdec [ –s seconds ] audio/wavdec [ –s seconds ] audio/sundec
audio/oggenc audio/pcmconv [ –i fmt ] [ –o fmt ] [ –l length ] audio/mixfs [ –D ] [ –s srvname ] [ –m mtpt ] [ /dev/audio ]
|
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. Decoding options The encoders read PCM on standard input and produce compressed audio on standard output. Flacenc, oggenc and mp3enc produce FLAC, 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).
Oggenc accept raw PCM in the same byte order as /dev/audio (little–endian),
while mp3enc –r expects big–endian. Flacenc by default expects raw
PCM in the same format as /dev/audio, but also supports signed
integer samples of bit widths 4 to 32, either little– or big–endian,
one to eight channels and
arbitrary samplerates, see –i option of pcmconv. Encoding options Long options Silly options 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.
Mixfs is a fileserver serving a single audio file which allows
simultaneous playback of audio streams. When run, it binds over
/dev/audio and mixes the audio samples that are written to it.
A service name srvname can be given with the –s option which gets
posted to /srv. By default, mixfs mounts itself on
/mnt/mix and then binds /mnt/mix/audio and /mnt/mix/volume over
/dev. /dev/volume from the parent namespace is proxied with an
additional control "mix" which is used to set the output volume
of the mixer. Another additional control "dev" can be used to switch
between audio devices. Mixfs will
resample incoming audio to the format of the audio device output
if it does not match the default (s16c2r44100). An alternative
mountpoint mtpt can be specified with the –m option. The –D option
causes 9p debug messages to be written to file–descriptor 2. |
EXAMPLE
Play back an .mp3
|
SOURCE
/sys/src/cmd/audio |
SEE ALSO
play(1), zuke(1) http://www.underbit.com/products/mad/ http://xiph.org/doc/ http://flac.sourceforge.net/documentation.html |
HISTORY
Pcmconv first appeared in 9front (December, 2012). Mixfs first
appeared in 9front (December, 2013). Flacenc first appeared in
9front (January, 2021). |