added the text showing when anouncent and fixed that sv-poup is used but not in package.json

This commit is contained in:
RezHackXYZ 2025-05-29 16:02:09 +05:30
parent f95327b8fc
commit a04c2a4faa
No known key found for this signature in database
4 changed files with 35 additions and 22 deletions

View file

@ -1,7 +1,14 @@
import { PlayingAnnouncement } from "./announcerData.svelte.js";
export function AnnounceUsingTTS(text) {
window.speechSynthesis.speak(
Object.assign(new SpeechSynthesisUtterance(text), {
rate: 0.5,
}),
);
}
PlayingAnnouncement.v = true;
const utterance = new SpeechSynthesisUtterance(text);
utterance.rate = 0.5;
utterance.onend = () => {
PlayingAnnouncement.v = false;
};
window.speechSynthesis.speak(utterance);
}