speak-promise

1.0.2 • Public • Published

speak-promise

  • Demo
  • Return Promise when using speechSynthesis.speak to speak the SpeechSynthesisUtterance instance.

Description

  • pending when has not actually been spoken.
  • resolve when has already been spoken.
    • end event of SpeechSynthesisUtterance
  • reject when error occurs.
    • error event of SpeechSynthesisUtterance

Usage

$ npm install speak-promise
import speakPromise from 'speak-promise'
let msg = new SpeechSynthesisUtterance('Hello world')
speakPromise(msg).then(/*do something*/) // ES6
await speakPromise(msg)  // ES7

Package Sidebar

Install

npm i speak-promise

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

1.61 kB

Total Files

4

Last publish

Collaborators

  • realdennis