This commit is contained in:
mkm 2023-10-13 18:38:15 +08:00
parent af1b902a25
commit 09ae2194d2

View File

@ -73,14 +73,14 @@ class Pusher
if ($status != 2) { if ($status != 2) {
if ($tts_type == 1) { if ($tts_type == 1) {
if (count($arr) == 2) { if (count($arr) == 2) {
$resp['payload']['choices']['tts_text'] = $text.$arr[0]; $resp['payload']['choices']['tts_text'] = $text . $arr[0];
unset($arr[0]); unset($arr[0]);
if(count($arr)>0){ if (count($arr) > 0) {
foreach ($arr as $k => $v) { foreach ($arr as $k => $v) {
$text .=$v; $text .= $v;
} }
}else{ } else {
$text =''; $text = '';
} }
$response = json_encode($resp, true); $response = json_encode($resp, true);
@ -92,11 +92,9 @@ class Pusher
} }
$connection->send($response); $connection->send($response);
} else { } else {
if (strlen($text) > 1) { $resp['payload']['choices']['tts_text'] = $text;
$resp['payload']['choices']['tts_text'] = $text; $text = '';
$text = ''; $response = json_encode($resp, true);
$response = json_encode($resp, true);
}
$connection->send($response); $connection->send($response);