mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-18 16:55:14 +02:00
tweaking audio capture
This commit is contained in:
+17
-5
@@ -9250,6 +9250,7 @@ Current version: 142
|
||||
selected_workers = [];
|
||||
localsettings.opmode = 1;
|
||||
}
|
||||
hide_popups();
|
||||
restart_new_game(true, document.getElementById("keep_memory").checked);
|
||||
hide_popups();
|
||||
}
|
||||
@@ -10089,10 +10090,14 @@ Current version: 142
|
||||
playSound.buffer = decodedData;
|
||||
playSound.connect(audioContext.destination);
|
||||
xtts_is_playing = true;
|
||||
update_submit_button(false);
|
||||
playSound.start(audioContext.currentTime);
|
||||
playSound.onended = function() {
|
||||
xtts_is_playing = false;
|
||||
console.log("Audio finished playing");
|
||||
setTimeout(() => {
|
||||
xtts_is_playing = false;
|
||||
update_submit_button(false);
|
||||
console.log("Audio finished playing");
|
||||
},300);
|
||||
};
|
||||
}).catch((error) => {
|
||||
console.log("XTTS Speak Error: " + error);
|
||||
@@ -10128,10 +10133,14 @@ Current version: 142
|
||||
playSound.buffer = decodedData;
|
||||
playSound.connect(audioContext.destination);
|
||||
xtts_is_playing = true;
|
||||
update_submit_button(false);
|
||||
playSound.start(audioContext.currentTime);
|
||||
playSound.onended = function() {
|
||||
xtts_is_playing = false;
|
||||
console.log("Audio finished playing");
|
||||
setTimeout(() => {
|
||||
xtts_is_playing = false;
|
||||
update_submit_button(false);
|
||||
console.log("Audio finished playing");
|
||||
},300);
|
||||
};
|
||||
}).catch((error) => {
|
||||
console.log("AllTalk Speak Error: " + error);
|
||||
@@ -10145,6 +10154,9 @@ Current version: 142
|
||||
let utterance = new window.SpeechSynthesisUtterance(text);
|
||||
utterance.voice = window.speechSynthesis.getVoices()[ssval - 1];
|
||||
window.speechSynthesis.speak(utterance);
|
||||
utterance.onend = function(event) {
|
||||
update_submit_button(false);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12664,7 +12676,7 @@ Current version: 142
|
||||
voice_is_recording = false;
|
||||
update_submit_button(false);
|
||||
}
|
||||
}, "500"); //prevent premature stopping
|
||||
}, 500); //prevent premature stopping
|
||||
},
|
||||
voice_start: function () {
|
||||
is_speaking = true;
|
||||
|
||||
Reference in New Issue
Block a user