/utters

Small (257B) promise wrapper for SpeechSynthesisUtterance

Primary LanguageJavaScriptMIT LicenseMIT

Utters

Small (257B) promise wrapper for SpeechSynthesisUtterance

Install

$ npm install utters

This module is delivered as:

Usage

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

API

utters(input)

Type: string|SpeechSynthesisUtterance
Returns: Promise<SpeechSynthesisUtterance>

License

MIT © Terkel Gjervig