Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

feat(runtime-html5): display ITN radio (#1392)

xuan11815a0726f1
diff --git a/runtime/html5/static/index.html b/runtime/html5/static/index.html
index d98c62bf9..de8139ef8 100644
--- a/runtime/html5/static/index.html
+++ b/runtime/html5/static/index.html
@@ -51,6 +51,12 @@
</div>
<br>
+ <div id="use_itn_div" style="border:2px solid #ccc;display:block;">
+ 逆文本标准化(ITN):<br/>
+ <label><input name="use_itn" type="radio" value="false" checked="true"/>否 </label>&nbsp;&nbsp;
+ <label><input name="use_itn" type="radio" value="true" />是 </label>
+ </div>
+ <br>
<div style="border:2px solid #ccc;">
热词设置(一行一个关键字,空格隔开权重,如"阿里巴巴 20"):
<br>
diff --git a/runtime/html5/static/main.js b/runtime/html5/static/main.js
index b3661cdfa..9a5a875d8 100644
--- a/runtime/html5/static/main.js
+++ b/runtime/html5/static/main.js
@@ -563,4 +563,14 @@ function recProcess( buffer, powerLevel, bufferDuration, bufferSampleRate,newBuf
}
+}
+
+function getUseITN() {
+ var obj = document.getElementsByName("use_itn");
+ for (var i = 0; i < obj.length; i++) {
+ if (obj[i].checked) {
+ return obj[i].value === "true";
+ }
+ }
+ return false;
}
\ No newline at end of file
diff --git a/runtime/html5/static/wsconnecter.js b/runtime/html5/static/wsconnecter.js
index 30b99d451..db140efc2 100644
--- a/runtime/html5/static/wsconnecter.js
+++ b/runtime/html5/static/wsconnecter.js
@@ -71,7 +71,7 @@ function WebSocketConnectMethod( config ) { //定义socket连接方法类
"wav_name": "h5",
"is_speaking": true,
"chunk_interval":10,
- "itn":false,
+ "itn":getUseITN(),
"mode":getAsrMode(),
};