Out-of-the-box
Promise
tts api, it depend on browser apiwindow.speechSynthesis
;
you can install package in your dependencies
yarn add ttspeech
# or
pnpm add ttspeech
import { speck } from "ttspeech";
speck("hello world!");
// you can hear "hello world!"
import { speck } from "ttspeech";
(async () => {
await speck("hello world!");
window.alert("speech end~");
})();
git clone https://github.com/AFine970/ttspeech.git
pnpm install
cd /packages/example && pnpm dev