Speex

From ArmadeusWiki
Jump to: navigation, search

Taken from http://www.speex.org/ : Speex is an Open Source/Free Software patent-free audio compression format designed for speech. The Speex Project aims to lower the barrier of entry for voice applications by providing a free alternative to expensive proprietary speech codecs.

Installation

  • Select the package in Buildroot menuconfig:
$ make menuconfig
Package Selection for the target  --->
    Audio libraries and applications  --->
        [*]   speex
  • Compile
$ make
  • Reflash your rootfs

Usage

Speex can be used from shell, thanks to the speexenc and speexdec command line tools:

# arecord /tmp/toto.wav
Recording WAVE '/tmp/toto.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
  • Then compress it:
# speexenc /tmp/toto.wav /tmp/toto.spx
Encoding 8000 Hz audio using narrowband mode (mono)

# ls -al /tmp/toto.*
-rw-r--r--    1 root     root        13303 Jan  1 01:24 /tmp/toto.spx
-rw-r--r--    1 root     root        53292 Jan  1 01:23 /tmp/toto.wav
  • To decompress it to a file:
# speexdec /tmp/toto.spx /tmp/toto_dec.wav
Decoding 8000 Hz audio using narrowband mode (mono)
Encoded with Speex 1.2rc1
  • To decompress it and play it "on the fly" (needs OSS emulation):
# modprobe snd-pcm-oss
# modprobe snd-mixer-oss
# speexdec /tmp/toto.spx

Programming with Speex

http://www.speex.org/docs/manual/speex-manual/node7.html

Links