forked from open-webui/open-webui
Add default voice setting and apply to chat
This commit is contained in:
parent
b6d9cf3bc8
commit
b297b432f7
3 changed files with 79 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import dayjs from 'dayjs';
|
||||
import { marked } from 'marked';
|
||||
import { settings, voices } from '$lib/stores';
|
||||
import tippy from 'tippy.js';
|
||||
import auto_render from 'katex/dist/contrib/auto-render.mjs';
|
||||
import 'katex/dist/katex.min.css';
|
||||
|
@ -116,6 +117,8 @@
|
|||
} else {
|
||||
speaking = true;
|
||||
const speak = new SpeechSynthesisUtterance(message.content);
|
||||
const voice = $voices?.filter((v) => v.name === $settings?.speakVoice)?.at(0) ?? undefined;
|
||||
speak.voice = voice;
|
||||
speechSynthesis.speak(speak);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue