Download presentation
Presentation is loading. Please wait.
Published byEzra McDonald Modified over 9 years ago
1
Speaker : Chungyi Wang Advisor: Quincy Wu Date : 2007.8.8
2
outline Introduction Why Speex ? Speex Tools – Windows Speex API – Linux Reference 2007/8/82
3
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
4
Why Speex ? (1/5) 2007/8/84 320 bytes PCM RTP 320 x 50 = 16000 (15.625 kb/sec) Need compression !!
5
Why Speex ? (2/5) 2007/8/85 Good compression ratio !! Speex encode Speex decode PCM RTP 320 bytes (6~62) bytes 320 bytes
6
Why Speex ? (3/5) 2007/8/86 From : http://www.speex.org/comparison/
7
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
8
Why Speex ? (5/5) Lossy Depend on quality (and compression ratio) From : http://en.wikipedia.org/wiki/Lossy_data_compressionhttp://en.wikipedia.org/wiki/Lossy_data_compression 2007/8/88
9
Speex Tools – Windows (1/4) Download http://downloads.us.xiph.org/releases/speex/speex- tools-win32-v1.2beta1.zip http://downloads.us.xiph.org/releases/speex/speex- tools-win32-v1.2beta1.zip Speex Tools speexenc.exe speexdec.exe 2007/8/89
10
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
11
Speex Tools – Windows (3/4) speexdec.exe speexdec [input_file] [outfile] input_file : spx outfile_file : wav 2007/8/811
12
Speex Tools – Windows (4/4) Demo 2007/8/812
13
Speex API – Linux (1/7) Download http://downloads.us.xiph.org/releases/speex/speex- 1.2beta1.tar.gz http://downloads.us.xiph.org/releases/speex/speex- 1.2beta1.tar.gz Setup Linphone - 2007/01/08 http://ms11.voip.edu.tw/~webmaster/meeting/ http://ms11.voip.edu.tw/~chungyi/ncnu- research/linphone/install.html http://ms11.voip.edu.tw/~chungyi/ncnu- research/linphone/install.html 2007/8/813
14
Speex API – Linux (2/7) #include For API of encoder and decoder Compile gcc –lspeex source.c 2007/8/814
15
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);
16
Speex API – Linux (4/7) QualityFrame_Size (Bytes) 06 110 215 320 4 528 6 738 8 946 1062 2007/8/816 For every 320-bytes
17
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
18
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);
19
Speex API – Linux (7/7) Demo >>./decode Result speex_decode.c speex_decode.txt 2007/8/819
20
Reference (1/2) Speex - main http://www.speex.org/ Speex - windows tools http://downloads.us.xiph.org/releases/speex/speex-tools-win32- v1.2beta1.zip http://downloads.us.xiph.org/releases/speex/speex-tools-win32- v1.2beta1.zip Speex - windows lib http://downloads.us.xiph.org/releases/speex/libspeex-win32- v1.2beta1.zip http://downloads.us.xiph.org/releases/speex/libspeex-win32- v1.2beta1.zip Speex - Development RPM http://downloads.us.xiph.org/releases/speex/speex-devel-1.2beta2- 1.i386.rpm http://downloads.us.xiph.org/releases/speex/speex-devel-1.2beta2- 1.i386.rpm 2007/8/820
21
Reference (2/2) Speex – API documentation (The Speex Codec Manual –very good!!) http://www.speex.org/docs/manual/speex-manual/ Speex – wiki http://en.wikipedia.org/wiki/Speex This ppt & demo http://ms11.voip.edu.tw/~chungyi/ncnu- research/Speex/Speex.zip http://ms11.voip.edu.tw/~chungyi/ncnu- research/Speex/Speex.zip 2007/8/821
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.