Ann: release of PySpeex - Python bindings for 'speex' speech codec

David McNab david at
Wed Mar 5 08:21:14 CET 2003


I've just created Python bindings for the 'Speex' speech codec (ref:

Speex as a codec enjoys the huge advantages of being multiplatform,
open-source and patent-free. For audio data consisting of speech, it
achieves compression of up to 40:1

With the Python bindings, it is now easy to use this excellent codec in
your Python programs. The binding simply implements a class called
'speex', with methods 'encode' and 'decode'. Full buffering on both
methods allows data to be passed in and taken out piecemeal.

Usage is as easy as:
  import speex

  # speech data is represented as a simple sequence of ints
  mySpeechData = [-23231, -23207, ...]

  # create codec object
  s = # '4' is quality (range 0 to 10)

  # encode this speech data
  encoded = s.encode(mySpeechData)


  # decode it
  decoded = s.decode(encoded)

Tarball, containing setup script and doco, available from:

Any suggestions, problems, queries, patches etc - email to me please.


More information about the Python-list mailing list