fix asr sessionid

main
lipku 7 months ago
parent 9ad00be5cd
commit bcc21c3c8a

@ -348,7 +348,7 @@ const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
async function is_speaking() { async function is_speaking() {
const response = await fetch('/is_speaking', { const response = await fetch('/is_speaking', {
body: JSON.stringify({ body: JSON.stringify({
sessionid: 0, sessionid: parseInt(parent.document.getElementById('sessionid').value),
}), }),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -396,6 +396,7 @@ function getJsonMessage( jsonMsg ) {
body: JSON.stringify({ body: JSON.stringify({
text: rectxt.replace(/ +/g,""), text: rectxt.replace(/ +/g,""),
type: 'chat', type: 'chat',
sessionid:parseInt(parent.document.getElementById('sessionid').value),
}), }),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'

@ -29,6 +29,8 @@
<label for="use-stun">Use STUN server</label> <label for="use-stun">Use STUN server</label>
</div> </div>
<button class="btn btn-primary" id="btn_play">Start</button> <button class="btn btn-primary" id="btn_play">Start</button>
<input type="hidden" id="sessionid" value="0">
<form class="form-inline" id="echo-form"> <form class="form-inline" id="echo-form">
<div class="form-group"> <div class="form-group">
<p>input text</p> <p>input text</p>

Loading…
Cancel
Save