1.0.2 • Published 5 years ago

speak-promise v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

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