From defc1687b7655bbcc4f5b4ca044e2323f9cd5d2d Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Wed, 9 Aug 2023 01:35:02 +0530 Subject: [PATCH] send float frames --- Audio-Transcription-Chrome/options.js | 9 +-------- Audio-Transcription-Firefox/content.js | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Audio-Transcription-Chrome/options.js b/Audio-Transcription-Chrome/options.js index fd2489e..756fe18 100644 --- a/Audio-Transcription-Chrome/options.js +++ b/Audio-Transcription-Chrome/options.js @@ -165,14 +165,7 @@ async function startRecord(option) { audioDataCache.push(inputData); - // feed inputs and run - const base64AudioData = btoa(String.fromCharCode.apply(null, new Uint8Array(audioData16kHz.buffer))); - - socket.send( - JSON.stringify({ - "audio": base64AudioData - }) - ); + socket.send(audioData16kHz); }; // Prevent page mute diff --git a/Audio-Transcription-Firefox/content.js b/Audio-Transcription-Firefox/content.js index fae2ac8..1d866c8 100644 --- a/Audio-Transcription-Firefox/content.js +++ b/Audio-Transcription-Firefox/content.js @@ -132,14 +132,7 @@ function startRecording(data) { audioDataCache.push(inputData); - // feed inputs and run - const base64AudioData = btoa(String.fromCharCode.apply(null, new Uint8Array(audioData16kHz.buffer))); - - socket.send( - JSON.stringify({ - "audio": base64AudioData - }) - ); + socket.send(audioData16kHz); }; // Prevent page mute