[asterisk-dev] speexenc and ControlPlayback garbled

Mike Taht mike.taht at gmail.com
Sun Feb 5 20:29:25 MST 2006


I said to myself: "Self - speex encoding is by far the most massive
computational load you can put on your asterisk server, but it sounds
better than gsm and you are running it anyway between your pbxes, why
not crunch the whole ivr system you are working on down to speex files
before hand?"

So (thinking that asterisk tries to open .spx files while looking for
a match) I tried it, but it  sounds totally unintelligble.

Is there some relationship between /etc/asterisk/codecs.conf and
speexenc, or magic parameter to hand speexenc? (I was figuring that a
speex file could be recorded at any complexity and played back, and
that codecs.conf just controls how much effort is put into encoding
live sound)

Looked in the bugtracker, didn't see a bug...

asterisk-svn + speex 1.1.11

#!/bin/sh

# Takes mp3s on the command line, converts to 8000 khz ulaw, gsm, speex

for i in $*
do
base=`echo $i | cut -f1 -d.`;
#madplay --output=$base.wav --sample-rate=8000 -b 16 --attenuate=-1 -m $i;
# I recompiled sox for madlib support. The resulting polyphase conversion is
# much better than what madplay outputs by default
sox $base.mp3 -r 8000 $base.wav polyphase -w ham # seems to give best results
# have tried various quality/comp settings
speexenc -n --quality 10 --comp 10 --bitrate 8000 $base.wav $base.spx
sox $base.wav $base.gsm # works
sox $base.wav $base.ul # works
mv $base.ul $base.ulaw
rm $base.wav # wav files are big

done


--
Mike Taht
PostCards From the Bleeding Edge
http://the-edge.blogspot.com



More information about the asterisk-dev mailing list