Subsections


Command-line encoder/decoder

The base Speex distribution includes a command-line encoder (speexenc) and decoder (speexdec). This section describes how to use these tools.


speexenc

The speexenc utility is used to create Speex files from raw PCM or wave files. It can be used by calling:

speexenc [options] input_file output_file
The value '-' for input_file or output_file corresponds respectively to stdin and stdout. The valid options are:

-narrowband (-n)
Tell Speex to treat the input as narrowband (8 kHz). This is the default
-wideband (-w)
Tell Speex to treat the input as wideband (16 kHz)
-ultra-wideband (-u)
Tell Speex to treat the input as ``ultra-wideband'' (32 kHz)
-quality n
Set the encoding quality (0-10), default is 8
-bitrate n
Encoding bit-rate (use bit-rate n or lower)
-vbr
Enable VBR (Variable Bit-Rate), disabled by default
-abr n
Enable ABR (Average Bit-Rate) at n kbps, disabled by default
-vad
Enable VAD (Voice Activity Detection), disabled by default
-dtx
Enable DTX (Discontinuous Transmission), disabled by default
-nframes n
Pack n frames in each Ogg packet (this saves space at low bit-rates)
-comp n
Set encoding speed/quality tradeoff. The higher the value of n, the slower the encoding (default is 3)
-V
Verbose operation, print bit-rate currently in use
-help (-h)
Print the help
-version (-v)
Print version information

Speex comments

-comment
Add the given string as an extra comment. This may be used multiple times.
-author
Author of this track.
-title
Title for this track.

Raw input options

-rate n
Sampling rate for raw input
-stereo
Consider raw input as stereo
-le
Raw input is little-endian
-be
Raw input is big-endian
-8bit
Raw input is 8-bit unsigned
-16bit
Raw input is 16-bit signed


speexdec

The speexdec utility is used to decode Speex files and can be used by calling:

speexdec [options] speex_file [output_file]
The value '-' for input_file or output_file corresponds respectively to stdin and stdout. Also, when no output_file is specified, the file is played to the soundcard. The valid options are:

-enh
enable post-filter (default)
-no-enh
disable post-filter
-force-nb
Force decoding in narrowband
-force-wb
Force decoding in wideband
-force-uwb
Force decoding in ultra-wideband
-mono
Force decoding in mono
-stereo
Force decoding in stereo
-rate n
Force decoding at n Hz sampling rate
-packet-loss n
Simulate n % random packet loss
-V
Verbose operation, print bit-rate currently in use
-help (-h)
Print the help
-version (-v)
Print version information

Jean-Marc Valin 2007-05-23