Google 語音辨識服務 (Automatic Speech Recognition ASR)
更多文章:
最近更新
2017/12/3:
未付費使用時,最多每月 60 分鐘,詳細參閱 https://cloud.google.com/speech/?hl=zh_TW2015/5/22:
由於 Google 變更了政策,如果要使用 ASR API,必須先註冊 Chrome-Dev Group 取得一組 API Key,詳細步驟可以參閱這篇 Adding Speech Recognition to Incredible PBX。
官方網站:http://zaf.github.com/asterisk-speech-recog/
系統需求:
適用系統:所有 Asterisk based 系統
延伸閱讀:
agi(speech-recog.agi,[lang],[timeout],[intkey],[NOBEEP])
Records from the current channel untill 3 seconds of silence are detected (this can be set by the user by the 'timeout' argument, -1 for no timeout) or the interrupt key (# by default) is pressed. If NOBEEP is set, no beep sound is played back to the user to indicate the start of the recording.
The recorded sound is send over to googles speech recognition service and the returned text string is assigned as the value of the channel variable 'utterance'. The scripts sets the following channel variables:
status : Return status. 0 means success, non zero values indicating different errors.
id : Some id string that googles engine returns, not very useful(?).
utterance : The generated text string.
confidence : A value between 0 and 1 indicating the probability of a correct recognition. Values bigger than 0.95 usually mean that the resulted text is correct.
支援的語言(代碼)
範例一:
;;Simple speech recognition exten => 1234,1,Answer() exten => 1234,n,agi(speech-recog.agi,en-US) exten => 1234,n,Verbose(1,The text you just said is: ${utterance}) exten => 1234,n,Verbose(1,The probability to be right is: ${confidence}) exten => 1234,n,Hangup()
範例二:
;;Speech recognition demo: exten => 1235,1,Answer() exten => 1235,n,agi(googletts.agi,"Say something in English, when done press the pound key.",en) exten => 1235,n(record),agi(speech-recog.agi,en-US) exten => 1235,n,Verbose(1,Script returned: ${status} , ${id} , ${confidence} , ${utterance}) ;Check return status: exten => 1235,n,GotoIf($["${status}" = "0"]?success:fail) ;Check the probability of a successful recognition: exten => 1235,n(success),GotoIf($["${confidence}" > "0.8"]?playback:retry) ;Playback the text: exten => 1235,n(playback),agi(googletts.agi,"The text you just said was...",en) exten => 1235,n,agi(googletts.agi,"${utterance}",en) exten => 1235,n,goto(end) ;Retry in case speech recognition wasn't successful: exten => 1235,n(retry),agi(googletts.agi,"Can you please repeat more clearly?",en) exten => 1235,n,goto(record) exten => 1235,n(fail),agi(googletts.agi,"Failed to get speech data.",en) exten => 1235,n(end),Hangup()
範例三:
應用於GV 語音傳簡訊,全文:http://nerdvittles.com/?p=813
; SMS Dictator for AsteriDex exten => 767,1,Answer exten => 767,n,Wait(1) exten => 767,n(record),Flite("After the beep. I will reecord your S.M.S message. When you're finished. press the pound key.") exten => 767,n,agi(speech-recog.agi,en-US) exten => 767,n,Noop(= Script returned: ${status} , ${id} , ${confidence} , ${utterance} =) exten => 767,n,Flite("I think you said: ${utterance}") exten => 767,n,Flite("If this is correct. press 1.") exten => 767,n,Flite("To start over. press 2.") exten => 767,n,Flite("To cancel and hang up. press 3.") exten => 767,n,Read(MYCHOICE,beep,1) exten => 767,n,GotoIf($["foo${MYCHOICE}" = "foo1"]?continue) exten => 767,n,GotoIf($["foo${MYCHOICE}" = "foo2"]?record) exten => 767,n,Playback(goodbye) exten => 767,n,Hangup exten => 767,n(continue),Set(SMSMSG=${utterance}) exten => 767,n(pickcontact),Flite("At the beep say the name of the person or company you wish to contact. Then press the pound key.") exten => 767,n,agi(speech-recog.agi,en-US) exten => 767,n,Noop(= Script returned: ${status} , ${id} , ${confidence} , ${utterance} =) exten => 767,n,AGI(nv-callwho.php,${utterance}) exten => 767,n,NoOp(Number to call: ${NUM2CALL}) exten => 767,n,GotoIf($["foo${NUM2CALL}" = "foo0"]?pickcontact) exten => 767,n,Flite("Sending S.M.S message. One moment please.") exten => 767,n,System(gvoice -e GVname@gmail.com -p GVpassword send_sms ${NUM2CALL} "${SMSMSG}") exten => 767,n,Flite("S.M.S message has been sent. Good bye.") exten => 767,n,Hangup
Images 0 | ||
---|---|---|
No images to display in the gallery. |