diff --git a/Audio-Transcription-Firefox/content.js b/Audio-Transcription-Firefox/content.js index eb8a32a..61a99fa 100644 --- a/Audio-Transcription-Firefox/content.js +++ b/Audio-Transcription-Firefox/content.js @@ -38,10 +38,16 @@ function resampleTo16kHZ(audioData, origSampleRate = 44100) { return resampledData; } -function startRecording(host, port) { - socket = new WebSocket(`ws://${host}:${port}/`); +function startRecording(data) { + socket = new WebSocket(`ws://${data.host}:${data.port}/`); socket.onopen = function(e) { - socket.send("handshake"); + socket.send( + JSON.stringify({ + multilingual: data.useMultilingual, + language: data.language, + task: data.task + }) + ); }; let isServerReady = false; @@ -209,7 +215,7 @@ browser.runtime.onMessage.addListener((request, sender, sendResponse) => { const { action, data } = request; if (action === "startCapture") { isCapturing = true; - startRecording(data.host, data.port); + startRecording(data); } else if (action === "stopCapture") { isCapturing = false; diff --git a/Audio-Transcription-Firefox/popup.html b/Audio-Transcription-Firefox/popup.html index 3766564..7393898 100644 --- a/Audio-Transcription-Firefox/popup.html +++ b/Audio-Transcription-Firefox/popup.html @@ -15,5 +15,121 @@ +