[feat] add tts in code
This commit is contained in:
6
src/ts/process/tts.ts
Normal file
6
src/ts/process/tts.ts
Normal 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)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user