Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 944 Bytes

readme.md

File metadata and controls

46 lines (28 loc) · 944 Bytes

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