refac: audio

This commit is contained in:
Timothy J. Baek
2024-06-07 20:18:48 -07:00
parent da47c2dfa3
commit 55dc6c1b3b
20 changed files with 769 additions and 464 deletions
@@ -169,7 +169,7 @@
mediaRecorder.ondataavailable = (event) => audioChunks.push(event.data);
mediaRecorder.onstop = async () => {
console.log('Recording stopped');
if (($settings?.audio?.STTEngine ?? '') === 'web') {
if (($settings?.audio?.stt?.engine ?? '') === 'web') {
audioChunks = [];
} else {
if (confirmed) {
@@ -186,7 +186,7 @@
};
mediaRecorder.start();
if (($settings?.audio?.STTEngine ?? '') === 'web') {
if (($settings?.audio?.stt?.engine ?? '') === 'web') {
if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
// Create a SpeechRecognition object
speechRecognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();