wardmundy
Nerd Uno
- Joined
- Oct 12, 2007
- Messages
- 19,206
- Reaction score
- 5,229
I don't use F-A-N-T-A-S-T-I-C quite as often as Steve Jobs, but Lefteris Zafiris has really outdone himself this time around. His new Asterisk AGI script gives you near perfect speech-to-text recognition using Google's speech recognition service. And it's FREE!
1. Install the AGI script by logging into your server and issuing the following commands:
Code:
cd /root
wget --no-check-certificate https://github.com/downloads/zaf/asterisk-speech-recog/asterisk-speech-recog-0.4.tar.gz
tar zxvf asterisk-speech*
cd asterisk-speech-recog-0.4
cp speech-recog.agi /var/lib/asterisk/agi-bin/.
cd /etc/asterisk
nano -w extensions_custom.conf
2. Now add the following sample code to /etc/asterisk/extensions_custom.conf at the top of the [from-internal-custom] context:
Code:
exten => 77325,1,Answer()
exten => 77325,n,flite("Say something in English, when done press the pound key.")
exten => 77325,n(record),agi(speech-recog.agi,en-US)
exten => 77325,n,Noop(= Script returned: ${status} , ${id} , ${confidence} , ${utterance} =)
;exten => 77325,n,GotoIf($["${status}" = "0"]?success:fail)
exten => 77325,n,flite("${utterance}")
exten => 77325,n,flite("Have a nice day! Good bye.")
exten => 77325,n,hangup
exten => 2255,1,Answer()
exten => 2255,2,Wait(1)
exten => 2255,3,flite("Say the number you wish to call. Then press the pound key.")
exten => 2255,4(record),agi(speech-recog.agi,en-US)
exten => 2255,5,Noop(= Script returned: ${status} , ${id} , ${confidence} , ${utterance} =)
exten => 2255,6,Set(NUM2CALL=${utterance})
exten => 2255,7,SayDigits("${NUM2CALL}")
exten => 2255,8,Background(vm-star-cancel)
exten => 2255,9,Background(vm-tocallnum)
exten => 2255,10,Read(PROCEED,beep,1)
exten => 2255,11,GotoIf($["foo${PROCEED}" = "foo1"]?12:13)
exten => 2255,12,Goto(outbound-allroutes,${NUM2CALL},1)
exten => 2255,13,hangup
3. Reload your dialplan: asterisk -rx "dialplan reload"
4. Now pick up a phone and dial S-P-E-A-K. When prompted, say a few words and press #. The speech-to-text script will pass your memorable words to Google, have it converted to text, and then say it back to you using Flite's Egor.
5. Next, pick up a phone and dial C-A-L-L. When prompted, say a phone number to dial and press #. Listen to the playback of the number. If it is correct, press 1 to place the call. Stay tuned for loads of apps!