mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
Update asr.js
This commit is contained in:
1 parent
15067279e3
commit
b2f88cdd94
1 file changed
+2
-1
@@ -40,10 +40,11 @@ async function startAsr(buffer) {
|
||||
ws = new WebSocket(url);
|
||||
ws.binaryType = 'arraybuffer';
|
||||
ws.onmessage = (event) => {
|
||||
const { code, result } = JSON.parse(event.data);
|
||||
const { code, result, message } = JSON.parse(event.data);
|
||||
if (code === 0) {
|
||||
art.plugins.artplayerPluginAsr.append(result?.voice_text_str);
|
||||
} else {
|
||||
console.error(code, message);
|
||||
stopAsr();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user