From 42c22787130b10636277de0e898370be89aeab13 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Mon, 31 Jul 2023 12:14:41 +0530 Subject: [PATCH] language to en if not multilingual --- Audio-Transcription-Chrome/options.js | 3 +++ Audio-Transcription-Firefox/content.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Audio-Transcription-Chrome/options.js b/Audio-Transcription-Chrome/options.js index 316d5b6..9f685b7 100644 --- a/Audio-Transcription-Chrome/options.js +++ b/Audio-Transcription-Chrome/options.js @@ -82,6 +82,9 @@ async function startRecord(option) { const socket = new WebSocket(`ws://${option.host}:${option.port}/`); let isServerReady = false; let language = option.language; + if (language === null && !option.multilingual) { + language = 'en'; + } socket.onopen = function(e) { socket.send( JSON.stringify({ diff --git a/Audio-Transcription-Firefox/content.js b/Audio-Transcription-Firefox/content.js index 5a6391e..d849b0d 100644 --- a/Audio-Transcription-Firefox/content.js +++ b/Audio-Transcription-Firefox/content.js @@ -42,6 +42,9 @@ function resampleTo16kHZ(audioData, origSampleRate = 44100) { function startRecording(data) { socket = new WebSocket(`ws://${data.host}:${data.port}/`); language = data.language; + if (language === null && !data.useMultilingual) { + language = 'en'; + } socket.onopen = function(e) { socket.send( JSON.stringify({