From 9a0cc4a4abdd7f1919927caf76b18b4c60f41c8c Mon Sep 17 00:00:00 2001 From: kwaroran Date: Sat, 13 May 2023 19:40:28 +0900 Subject: [PATCH] [feat] add tts in code --- src/ts/process/tts.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/ts/process/tts.ts diff --git a/src/ts/process/tts.ts b/src/ts/process/tts.ts new file mode 100644 index 00000000..2b4ac802 --- /dev/null +++ b/src/ts/process/tts.ts @@ -0,0 +1,6 @@ +export async function sayTTS(text:string) { + const utterThis = new SpeechSynthesisUtterance(text); + const voices = speechSynthesis.getVoices(); + utterThis.voice = voices[0] + speechSynthesis.speak(utterThis) +} \ No newline at end of file