Speaker : Chungyi Wang Advisor: Quincy Wu Date :
outline Introduction Why Speex ? Speex Tools – Windows Speex API – Linux Reference 2007/8/82
Introduction What is the Speex ? One kind of compression software (or API) What is the main advantage of the Speex ? Good compression ratio (and variable) What kinds of application need the Speex ? Audio file (ex.ogg, spx) VoIP 2007/8/83
Why Speex ? (1/5) 2007/8/ bytes PCM RTP 320 x 50 = ( kb/sec) Need compression !!
Why Speex ? (2/5) 2007/8/85 Good compression ratio !! Speex encode Speex decode PCM RTP 320 bytes (6~62) bytes 320 bytes
Why Speex ? (3/5) 2007/8/86 From :
Why Speex ? (4/5) Speex is based on CELP and is designed to compress voice at bitrates ranging from 2 to 44 kbps. Some of Speex's features include: - Narrowband (8 kHz), wideband (16 kHz), and ultrawideband (32 kHz) compression in the same bitstream - Intensity stereo encoding - Packet loss concealment - Variable bitrate operation (VBR) - Voice Activity Detection (VAD) - Discontinuous Transmission (DTX) - Fixed-point port - Acoustic echo canceller - Noise suppression 2007/8/87
Why Speex ? (5/5) Lossy Depend on quality (and compression ratio) From : /8/88
Speex Tools – Windows (1/4) Download tools-win32-v1.2beta1.zip tools-win32-v1.2beta1.zip Speex Tools speexenc.exe speexdec.exe 2007/8/89
Speex Tools – Windows (2/4) speexenc.exe speexenc [input_file] [outfile] input_file : wav outfile_file : spx speexenc –quality n [input_file] [outfile] n : Quality (10-0) 2007/8/810
Speex Tools – Windows (3/4) speexdec.exe speexdec [input_file] [outfile] input_file : spx outfile_file : wav 2007/8/811
Speex Tools – Windows (4/4) Demo 2007/8/812
Speex API – Linux (1/7) Download 1.2beta1.tar.gz 1.2beta1.tar.gz Setup Linphone /01/ research/linphone/install.html research/linphone/install.html 2007/8/813
Speex API – Linux (2/7) #include For API of encoder and decoder Compile gcc –lspeex source.c 2007/8/814
Speex API – Linux (3/7) 2007/8/815 Encoder Init One round encode Destory encoder void *state = speex_encoder_init(&speex_nb_mode); SpeexBits bits; speex_bits_init(&bits); speex_encoder_ctl(state, SPEEX_SET_QUALITY, &quality); speex_bits_reset(&bits); speex_encode(state, input, &bits); int nbBytes = speex_bits_write(&bits, cbits, 200); speex_encoder_destroy(state); speex_bits_destroy(&bits);
Speex API – Linux (4/7) QualityFrame_Size (Bytes) /8/816 For every 320-bytes
Speex API – Linux (5/7) Demo >>make >>gcc -lspeex speex_encode.c -o encode >>gcc -lspeex speex_decode.c -o decode >>./encode Result Makefile speex_encode.c speex_encode.txt 2007/8/817
Speex API – Linux (6/7) 2007/8/818 Decoder Init One round decode Destory decoder void *state speex_decoder_init(&speex_nb_mode); SpeexBits bits; speex_bits_init(&bits); speex_bits_read_from(&bits, cbits[j], nbBytes); speex_decode(state, &bits, output); speex_decoder_destroy(state); speex_bits_destroy(&bits);
Speex API – Linux (7/7) Demo >>./decode Result speex_decode.c speex_decode.txt 2007/8/819
Reference (1/2) Speex - main Speex - windows tools v1.2beta1.zip v1.2beta1.zip Speex - windows lib v1.2beta1.zip v1.2beta1.zip Speex - Development RPM 1.i386.rpm 1.i386.rpm 2007/8/820
Reference (2/2) Speex – API documentation (The Speex Codec Manual –very good!!) Speex – wiki This ppt & demo research/Speex/Speex.zip research/Speex/Speex.zip 2007/8/821