From bcc21c3c8ac1f02bbbe7cc83692b1dc4b144c385 Mon Sep 17 00:00:00 2001 From: lipku Date: Wed, 25 Dec 2024 18:10:32 +0800 Subject: [PATCH] fix asr sessionid --- web/asr/main.js | 3 ++- web/rtcpushapi-asr.html | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/asr/main.js b/web/asr/main.js index 8811fd6..0d3e10d 100644 --- a/web/asr/main.js +++ b/web/asr/main.js @@ -348,7 +348,7 @@ const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay)) async function is_speaking() { const response = await fetch('/is_speaking', { body: JSON.stringify({ - sessionid: 0, + sessionid: parseInt(parent.document.getElementById('sessionid').value), }), headers: { 'Content-Type': 'application/json' @@ -396,6 +396,7 @@ function getJsonMessage( jsonMsg ) { body: JSON.stringify({ text: rectxt.replace(/ +/g,""), type: 'chat', + sessionid:parseInt(parent.document.getElementById('sessionid').value), }), headers: { 'Content-Type': 'application/json' diff --git a/web/rtcpushapi-asr.html b/web/rtcpushapi-asr.html index 01cc632..8cef368 100644 --- a/web/rtcpushapi-asr.html +++ b/web/rtcpushapi-asr.html @@ -29,6 +29,8 @@ + +

input text