From 23d09c8e51c8336a64743f476b481c7f07791d5f Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 12 Oct 2023 16:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E8=AF=AD=E9=9F=B3=E9=9D=99=E6=80=81?= =?UTF-8?q?=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/xf_voice/index.html | 1 + public/xf_voice/js/transcode.worker.js | 5 ++++- public/xf_voice/js/voice.js | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/xf_voice/index.html b/public/xf_voice/index.html index 8f19e0f45..7156f3bb5 100644 --- a/public/xf_voice/index.html +++ b/public/xf_voice/index.html @@ -82,6 +82,7 @@ console.log(text,'11111') voice.start(); } } + function addcloEvenPassthrough() { window.closeEvent = function(info) { console.log('2222') diff --git a/public/xf_voice/js/transcode.worker.js b/public/xf_voice/js/transcode.worker.js index e79c1e1af..9d5928f8f 100644 --- a/public/xf_voice/js/transcode.worker.js +++ b/public/xf_voice/js/transcode.worker.js @@ -5,7 +5,8 @@ } let transAudioData = { - transcode(audioData) { + transcode(audioData) { + let output = transAudioData.to16kHz(audioData) output = transAudioData.to16BitPCM(output) output = Array.from(new Uint8Array(output.buffer)) @@ -41,5 +42,7 @@ } return dataView } + + } })(); \ No newline at end of file diff --git a/public/xf_voice/js/voice.js b/public/xf_voice/js/voice.js index 977c49cef..b4d963268 100644 --- a/public/xf_voice/js/voice.js +++ b/public/xf_voice/js/voice.js @@ -266,7 +266,7 @@ } return false; }; - console.log(this.audioData) + // 中间帧 this.webSocket.send( JSON.stringify({