( e )
| 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); |
no test coverage detected
searching dependent graphs…