[feat] add tts in code

This commit is contained in:
kwaroran
2023-05-13 19:40:28 +09:00
parent b815ea8a74
commit 9a0cc4a4ab

6
src/ts/process/tts.ts Normal file
View File

@@ -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)
}