功能:開始一個語音識別,一邊講話,一邊識別,須要ASR服務器。git
原型:MRCPRecog (grammar, options)緩存
grammar ---- 語法文件,能夠是一個xml文件服務器
options ---- 選項,具體見下面的描述ide
MRCPRecog的選項參數
Name Description
p ------- profile to use in mrcp.conf
i ------- digits to allow recognition to be interrupted with (by default DTMFs are sent to the MRCP server to recognize; otherwise, if "any" or other digits are specified, recognition will be interrupted)
輸入一個數字,識別就會被打斷。能夠填"any",或一個數字
f ------- filename on play (if empty or not specified, no file is played)
一個wav文件的名字,會給客戶播放這個提示音。
t ----- recognition timeout (msec)
語音識別的超時時間,單位毫秒,如 t=10000 表示10秒。
b ------ barge-in value (no barge-in allowed=0, barge-in allowed=1)
是否容許語音打斷,填0或1
gd ---- grammar delimiters 語法分隔符
ct ----- confidence threshold (0.0 - 1.0)
置信度閾值(不明白什麼意思)
sl ----- sensitivity level (0.0 - 1.0) 靈敏度等級
sva ----- speed versus accuracy (0.0 - 1.0) 速度和準確性
nb ----- n-best list length
nit ----- no input timeout (msec) 沒有輸入時的超時時間
sct ----- speech complete timeout (msec)
sint ----- speech incomplete timeout (msec)
dit ----- DTMF interdigit timeout (msec)
dtt ----- DTMF terminate timeout (msec)
dttc ----- DTMF terminate characters DTMF打斷的字符
sw ----- save waveform (true/false)
nac ----- new audio channel (true/false) 新的語音通道
spl ------ speech language (en-US/en-GB/etc.) 語音識別的語言,英文或者中文
rm ------- recognition mode (normal/hotword) 語音識別模式,普通或者熱詞
hmaxd ----- hotword max duration (msec) 熱詞最大時間
hmind ----- hotword min duration (msec) 熱詞最小時間
cdb ----- clear DTMF buffer (true/false) 清除DTMF緩存
enm ----- early no match (true/false)
iwu ----- input waveform URI
mt ---- media type 媒體類型
epe
exit on play error (1: terminate recognition on file play error, 0: continue even if file play fails)
播放失敗時的處理方式
1---結束識別
0--- 繼續識別
uer ---- URI-encoded results (1: URI-encode NLMSL results, 0: do not encode)
1--- 編碼成NLMSL 結果
0--- 不要編碼
od ---- Output (prompt) delimiters. 輸出的分隔符
sit
Start input timers value
(0: no,
1: yes [start with RECOGNIZE],
2: auto [start when prompt is finished])
啓動輸入計時器值
0 --- 不
1 --- 容許,從識別開始
2 --- 自動,等提示音播放完畢再開始