Speex-1.2.1

Introduction to Speex

Speex is an audio compression format designed specifically for speech. It is well-adapted to Internet applications and provides useful features that are not present in most other CODECs.

Package Information

Speex Dependencies

Required
libogg-1.3.6

Installation of Speex

This package consists of two separate tarballs. They will be built one after the other.

Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the sudo package.

  3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root

Start a subshell that will exit on error:

bash -e

Install Speex by running the following commands:

for package in speex-* speexdsp-*; do
  packagedir=${package%.tar.?z*}
  tar xf $package
  pushd $packagedir
    ./configure --prefix=/usr    \
                --disable-static \
                --docdir=/usr/share/doc/$packagedir
    make
    as_root make install
  popd
  rm -rf $packagedir
done

For multilib:

for package in speex-* speexdsp-*; do
  packagedir=${package%.tar.?z*}
  tar xf $package
  pushd $packagedir
    CC="gcc -m32" CXX="g++ -m32"                     \
    PKG_CONFIG=/usr/bin/i686-pc-linux-gnu-pkg-config \
    ./configure --prefix=/usr                        \
                 --libdir=/usr/lib32                 \
                 --host=i686-pc-linux-gnu            \
                 --disable-static
    make
    make DESTDIR=$PWD/DESTDIR install
    as_root cp -vR DESTDIR/usr/lib32/* /usr/lib32
    as_root ldconfig
  popd
  rm -rf $packagedir
done

Exit out of the subshell that was started earlier:

exit

Command Explanations

Note

Run ./configure --help for a full list of options.

--disable-static: This switch prevents installation of static versions of the libraries.

Contents

Installed Programs: speexenc and speexdec
Installed Libraries: libspeex and libspeexdsp
Installed Directories: /usr/include/speex and /usr/share/doc/speex-1.2.1

Short Descriptions

speexdec

decodes a Speex file and produces a WAV or raw file

speexenc

encodes a WAV or raw file using Speex

libspeex

provides functions for the audio encoding/decoding programs

libspeexdsp

is a speech processing library that goes along with the Speex codec