fix: audio ducking
This commit is contained in:
796
src-tauri/Cargo.lock
generated
796
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,7 @@ tauri-plugin-keep-screen-on = "0.1.2"
|
||||
tauri-plugin-upload = "2"
|
||||
tauri-plugin-fs = "2"
|
||||
tauri-plugin-tts = { git = "https://github.com/cfpwastaken/tauri-plugin-tts.git" }
|
||||
tauri-plugin-duck = { git = "https://git.picoscratch.de/trafficcue/tauri-plugin-duck.git" }
|
||||
reqwest = { version = "0.12.23", default-features = false, features = ["rustls-tls"] }
|
||||
diqwest = "3.1.0"
|
||||
minidom = "0.17.0"
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
]
|
||||
},
|
||||
"upload:allow-download",
|
||||
"tts:allow-speak"
|
||||
"tts:allow-speak",
|
||||
"duck:default"
|
||||
]
|
||||
}
|
||||
@ -8,6 +8,7 @@ pub fn run() {
|
||||
.plugin(tauri_plugin_upload::init())
|
||||
.plugin(tauri_plugin_keep_screen_on::init())
|
||||
.plugin(tauri_plugin_tts::init())
|
||||
.plugin(tauri_plugin_duck::init())
|
||||
.setup(|app| {
|
||||
if cfg!(debug_assertions) {
|
||||
app.handle().plugin(
|
||||
|
||||
@ -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