Small (257B) promise wrapper for SpeechSynthesisUtterance
$ npm install utters
This module is delivered as:
- ES Module:
dist/index.mjs
- UMD:
dist/utters.umd.js
- UMD Minified:
dist/utters.umd.min.js
import utters from 'utters';
function speak() {
// string input
await utters(`Hello World`);
// SpeechSynthesisUtterance input
await utters(new SpeechSynthesisUtterance(`Hello World`));
console.log(`Done!`);
}
Read more about how to use the SpeechSynthesis
API on MDN
Type: string|SpeechSynthesisUtterance
Returns: Promise<SpeechSynthesisUtterance>
MIT © Terkel Gjervig