language to en if not multilingual

This commit is contained in:
makaveli10
2023-07-31 12:14:41 +05:30
parent 6a78c51ce4
commit 42c2278713
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -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({
+3
View File
@@ -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({