简体   繁体   English

如何让 Twilio 语音识别接受任何内容?

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

I am currently working on a call script that notifies callers when a call is received.我目前正在开发一个呼叫脚本,当接到呼叫时通知呼叫者。 In order to connect the receiver of the call presses 1 or says 'yes' to accept.要连接呼叫的接收者,请按 1 或说“是”以接受。

The problem is that the #1 prompt is not always recognized and even when the receiver says 'yes' it is sometimes not recognized.问题是#1 提示并不总是被识别,即使接收者说“是”,有时也无法识别。 I don't think it is the code, but rather with the type of phone or way the receiver is saying yes.我不认为这是代码,而是与电话类型或接收者说“是”的方式有关。

I'd like to modify this so that the receiver can say anything.我想修改它,以便接收者可以说任何话。 Basically if the call receiver makes any verbal noise it will work.基本上,如果呼叫接收器发出任何言语噪音,它就会起作用。 I understand that this does not sound ideal, but for my system it would work fine.我知道这听起来并不理想,但对于我的系统来说它可以正常工作。

A snippet of the code for this I have currently is:我目前拥有的代码片段是:

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 {
}

Any help would be greatly appreciated.任何帮助将不胜感激。

Thank you谢谢

Try just to play with the number of letters recognized (let's call it a noise)尝试使用识别的字母数量(我们称之为噪音)

//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