G.729 and G.723.1 codecs for Asterisk open source PBX. http://asterisk.hosting.lv/ http://groups.google.com/group/asterisk-g729 Asterisk 1.4, 1.6, 1.8, and TRUNK are supported. Use binaries from the website for Asterisk 1.2 and Callweaver. To compile the codecs it is recommended to install Intel IPP libraries for production-level performance. Otherwise a slower ANSI C codecs implementation provided by ITU-T will be used. Tested against IPP 5.3, 6.0, and 6.1. Use IPP 5.3 for Pentium3, and 6.0+ for Atom CPU. Download from http://software.intel.com/en-us/articles/non-commercial-software-download/ AMD processors works with IPP without problems. In case you do not want to install IPP, then you'll get twice better performance out of ITU-T code if you build it with GCC 4.5 or Intel CC with LTO/IPO enabled. Still, even with ICC, it is 10x slower than IPP - 30ms vs 3ms of processor time to encode one second of G.729 audio on modern hardware. G.723 is around 100ms. GCC with LTO is 2x slower than ICC. With ITU-T code, Core2 class processor is recommended. There are two ways to build the codecs: 1. Use ./configure. Check the available options with ./configure --help. Specify --prefix in case Asterisk is installed in non-standard location. ICC support is work in progress, please set CFLAGS for now. 2. Edit build-ipp.sh (IPP) or build-itu.sh (ITU-T) to select Asterisk version, compiler, and preferred optimization parameters. G.723.1 send rate is configured in Asterisk codecs.conf file: [g723] ; 6.3kbps stream, default sendrate=63 ; 5.3kbps ;sendrate=53 This option is for outgoing voice stream only. It does not affect incoming stream that should be decoded automatically whatever the bitrate is. There are also two Asterisk CLI commands "g723 debug" and "g729 debug" to print statistics about received frames sizes. This can aid in debugging audio problems. You need to bump Asterisk verbosity level to 3 to see the numbers. astconv is audio format conversion utility similar to Asterisk "file convert" command. It could be built by supplied build-astconv.sh script against Asterisk 1.6.1 or later. It uses codec_*.so modules directly to perform the conversion. You need a _matching_ Asterisk codec module, which means 1.6.1 or later. The translation result could be used to: 1. confirm the codec is working properly; 2. prepare voicemail prompts, for example: ./astconv ./codec_g729.so -e 160 file.slin file.g729 ./astconv ./codec_g729.so -d 10 file.g729 file.slin ./astconv ./codec_g723.so -e 480 file.slin file.g723 ./astconv ./codec_g723.so -d 24 file.g723 file.slin file.slin is signed linear 16-bin 8kHz mono audio, you can play it with aplay -f S16_LE file.slin and convert to/from other formats with SOX: sox input.wav -e signed-integer -b 16 -c 1 -r 8k -t raw output.slin sox -t raw -e signed-integer -b 16 -c 1 -r 8k input.slin output.wav Files: - codec_g72x.c - GPL, code is based on code by Daniel Pocock at http://www.readytechnology.co.uk/open/ipp-codecs/ and various Asterisk bundled codecs; - astconv.c - GPL; - build*.sh - compile scripts; - autotools files initially contributed by Michael E. Kromer Michael.Kromer at computergmbh dot de; - g723_slin_ex.h, g729_slin_ex.h, slin_g72x_ex.h - sample speech data; - ipp/ files are copied from IPP samples, IPP license apply; - itu/ files are ITU-T reference implementations, modified G.729A ripped from FreeSWITCH fs_itu_g729 codec. G.723.1 modified to use TLS variables. Before reporting any problem with the codecs, please read the website and make sure you know what you're doing - compiling the codecs is not a novice task. Asking Asterisk G.729 Google group first is also good idea. Author: Arkadi.Shishlov at gmail dot com