|
@@ -491,7 +491,7 @@ async function handleAudioToText() {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- let url = `https://cmm.ai:9001/gcp/speech-to-text?language_code=${audioLang}`;
|
|
|
+ let url = `https://cmm.ai:8123/process-audio/`;
|
|
|
|
|
|
const formData = new FormData();
|
|
|
formData.append("file", audioFile.value);
|
|
@@ -502,10 +502,13 @@ async function handleAudioToText() {
|
|
|
console.log("語音轉文字 response", response);
|
|
|
// showAnchor.value = false; // 關閉主播視窗
|
|
|
|
|
|
- userMessage.value = response.data[0];
|
|
|
+ // userMessage.value = response.data[0];
|
|
|
+ console.log(response.data.message);
|
|
|
+ userMessage.value = response.data.message;
|
|
|
+
|
|
|
// handleTTS(userMessage.value); // 取得語音回覆
|
|
|
|
|
|
- if (response.data[0] && response.data[0] !== "") {
|
|
|
+ if (response.data.message !== "") {
|
|
|
sendMessage(); // 傳送使用者訊息
|
|
|
} else {
|
|
|
if (showAnchor.value) {
|