yodaos-project/yoda.js

vui: voice ui component

Closed this issue · 2 comments

Is your feature request related to a problem? Please describe.
Ease developer concerned voice UI events implementation.

Describe the solution you'd like

var vf = new VoiceFlow([
  /* Automatically handles SpeechSynthesisUtterance resolution/cancellation */
  () => synth.speak('Playback down'), 
  /* Automatically handles MediaPlayer resolution/cancellation */
  () => new MediaPlayer().start('/data/media/music.mp3'),
  (done, onCancel) => {
    var customPlayer = new SomePlayer()
      .on('end', () => done())
    onCancel(() => player.stop())
  }
])
vf.start() // Acquires audio focus
setTimeout(() => vf.cancel(), 1000) // Abandons audio focus

Describe alternatives you've considered
TODO.

This looks good on linear task, do we need a flow that do works in parallel?

Landed on #652