diff --git a/src/hooks/useTxt2Voice.ts b/src/hooks/useTxt2Voice.ts index 7bf984f..a6885b4 100644 --- a/src/hooks/useTxt2Voice.ts +++ b/src/hooks/useTxt2Voice.ts @@ -10,7 +10,7 @@ const useTxt2Voice = () => { utterance.pitch = 1; utterance.text = text; //@ts-ignore - synthesizer.speak(utterance); + synthesizer && synthesizer.speak(utterance); } const stop = () => { //@ts-ignore