MCPcopy Create free account
hub / github.com/modelscope/FunASR / onOpen

Function onOpen

runtime/html5/static/wsconnecter.js:66–99  ·  view source on GitHub ↗
( e )

Source from the content-addressed store, hash-verified

64
65 // SOCEKT连接中的消息与状态响应
66 function onOpen( e ) {
67 // 发送json
68 var chunk_size = new Array( 5, 10, 5 );
69 var request = {
70 "chunk_size": chunk_size,
71 "wav_name": "h5",
72 "is_speaking": true,
73 "chunk_interval":10,
74 "itn":getUseITN(),
75 "mode":getAsrMode(),
76
77 };
78 if(isfilemode)
79 {
80 request.wav_format=file_ext;
81 if(file_ext=="wav")
82 {
83 request.wav_format="PCM";
84 request.audio_fs=file_sample_rate;
85 }
86 }
87
88 var hotwords=getHotwords();
89
90 if(hotwords!=null )
91 {
92 request.hotwords=hotwords;
93 }
94 console.log(JSON.stringify(request));
95 speechSokt.send(JSON.stringify(request));
96 console.log("连接成功");
97 stateHandle(0);
98
99 }
100
101 function onClose( e ) {
102 stateHandle(1);

Callers 1

WebSocketConnectMethodFunction · 0.70

Calls 4

getUseITNFunction · 0.70
getAsrModeFunction · 0.70
getHotwordsFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…