From 66e5b4c9f23e2a80fe661ecd14afb96f61ec2a22 Mon Sep 17 00:00:00 2001 From: zjt <937178071@qq.com> Date: Mon, 24 Jun 2024 18:56:05 +0800 Subject: [PATCH] error --- src/hooks/useTxt2Voice.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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