fix: audio ducking
This commit is contained in:
@@ -30,7 +30,8 @@ export default async function say(text: string, language?: Locale) {
|
||||
await initTTS();
|
||||
// return;
|
||||
}
|
||||
duck();
|
||||
await duck();
|
||||
await new Promise((resolve) => setTimeout(resolve, 500)); // wait a bit for ducking to take effect
|
||||
if (tts !== "web") {
|
||||
try {
|
||||
await invoke("plugin:tts|speak", {
|
||||
@@ -48,5 +49,5 @@ export default async function say(text: string, language?: Locale) {
|
||||
utterance.lang = m["language.speechSynthesis"]();
|
||||
window.speechSynthesis.speak(utterance);
|
||||
}
|
||||
unduck();
|
||||
await unduck();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user