mirror of
https://github.com/dergigi/boris.git
synced 2026-01-20 23:34:52 +01:00
fix(tts): sync default rate changes from settings without refresh
This commit is contained in:
@@ -49,6 +49,13 @@ export function useTextToSpeech(options: UseTTSOptions = {}): UseTTS {
|
||||
|
||||
const utteranceRef = useRef<SpeechSynthesisUtterance | null>(null)
|
||||
|
||||
// Update rate when defaultRate option changes
|
||||
useEffect(() => {
|
||||
if (options.defaultRate !== undefined) {
|
||||
setRate(options.defaultRate)
|
||||
}
|
||||
}, [options.defaultRate])
|
||||
|
||||
// Load voices (async in many browsers)
|
||||
useEffect(() => {
|
||||
if (!supported) return
|
||||
|
||||
Reference in New Issue
Block a user