簡體   English   中英

如何讓 Twilio 語音識別接受任何內容?

[英]How to Have Twilio Speech Recognition Accept Anything?

我目前正在開發一個呼叫腳本,當接到呼叫時通知呼叫者。 要連接呼叫的接收者,請按 1 或說“是”以接受。

問題是#1 提示並不總是被識別,即使接收者說“是”,有時也無法識別。 我不認為這是代碼,而是與電話類型或接收者說“是”的方式有關。

我想修改它,以便接收者可以說任何話。 基本上,如果呼叫接收器發出任何言語噪音,它就會起作用。 我知道這聽起來並不理想,但對於我的系統來說它可以正常工作。

我目前擁有的代碼片段是:

if($content_array['Digits'] == 1 || stripos($content_array['SpeechResult'], 'yes')!==false) {
$model_accepted = true;
$sql_update1 = array("call_status" => 'model_accepted');
$where_clause1 = "id = '".$twillio_ivr_logs_array[0]['id']."'";
$updated_return1 = $sqlObj->updateArray('twillio_ivr_logs', $sql_update1, $where_clause1);
$sql_update= array( "status" => "connected");
$where_clause = "id = '".$order_array[0]['id']."'";
$update_mg = $sqlObj->updateArray('client_orders', $sql_update, $where_clause);
$accepted = "true";
} else {
$model_accepted = false;
$sql_update1 = array("call_status" => 'model_rejected');
$where_clause1 = "id = '".$twillio_ivr_logs_array[0]['id']."'";
$updated_return1 = $sqlObj->updateArray('twillio_ivr_logs', $sql_update1, $where_clause1);
$sql_update= array( "status" => "rejected");
$where_clause = "id = '".$order_array[0]['id']."'";
$update_mg = $sqlObj->updateArray('client_orders', $sql_update, $where_clause); 
}
} else {
}

任何幫助將不勝感激。

謝謝

嘗試使用識別的字母數量(我們稱之為噪音)

//number of letters recognized with spaces
$noiseLength = 2;

if(isset($content_array['Digits']) || strlen($content_array['SpeechResult']) > $noiseLength) {

}

if($content_array['Digits'] == 1 || strlen($content_array['SpeechResult']) > $noiseLength) {

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM