fix: audio ducking
All checks were successful
TrafficCue CI / check (push) Successful in 1m42s
TrafficCue CI / build (push) Successful in 10m19s
TrafficCue CI / build-android (push) Successful in 25m50s

This commit is contained in:
2025-10-21 17:47:06 +02:00
parent 372b31876d
commit 5ec74129e2
5 changed files with 389 additions and 417 deletions

796
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -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"

View File

@ -36,6 +36,7 @@
]
},
"upload:allow-download",
"tts:allow-speak"
"tts:allow-speak",
"duck:default"
]
}

View File

@ -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(

View File

@ -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();
}