utters

Small promise wrapper for SpeechSynthesisUtterance

Usage no npm install needed!

<script type="module">
  import utters from 'https://cdn.skypack.dev/utters';
</script>

README

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!`);
}

API

utters(input)

Type: string|SpeechSynthesisUtterance
Returns: Promise<SpeechSynthesisUtterance>

License

MIT © Terkel Gjervig