mirror of
https://github.com/open-webui/open-webui
synced 2024-11-06 08:56:39 +00:00
refac: audio
This commit is contained in:
parent
27417dd771
commit
c6b74a3cf9
@ -267,7 +267,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full">
|
||||
<div class=" mb-2.5 text-sm font-medium">{$i18n.t('TTS Model')}</div>
|
||||
<div class=" mb-1.5 text-sm font-medium">{$i18n.t('TTS Model')}</div>
|
||||
<div class="flex w-full">
|
||||
<div class="flex-1">
|
||||
<input
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { createEventDispatcher, tick, getContext } from 'svelte';
|
||||
import { settings } from '$lib/stores';
|
||||
import { config, settings } from '$lib/stores';
|
||||
import { blobToFile, calculateSHA256, findWordIndices } from '$lib/utils';
|
||||
|
||||
import { transcribeAudio } from '$lib/apis/audio';
|
||||
@ -185,8 +185,7 @@
|
||||
}
|
||||
};
|
||||
mediaRecorder.start();
|
||||
|
||||
if (($settings?.audio?.stt?.engine ?? '') === 'web') {
|
||||
if ($config.audio.stt.engine === 'web' || ($settings?.audio?.stt?.engine ?? '') === 'web') {
|
||||
if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
|
||||
// Create a SpeechRecognition object
|
||||
speechRecognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
||||
@ -195,7 +194,7 @@
|
||||
speechRecognition.continuous = true;
|
||||
|
||||
// Set the timeout for turning off the recognition after inactivity (in milliseconds)
|
||||
const inactivityTimeout = 3000; // 3 seconds
|
||||
const inactivityTimeout = 2000; // 3 seconds
|
||||
|
||||
let timeoutId;
|
||||
// Start recognition
|
||||
|
Loading…
Reference in New Issue
Block a user