Cycle.js drivers and action components for playing sounds using HTMLAudioElement.
Try the demo at StackBlitz!
Note that this package was tested with Chrome browser (>= 65.0.3325.181) only.
AudioPlayerAction action component.
- sources
- goal: a stream of
{src: string}
(as HTML audio src) or a string (as a value ofsrc
). - AudioPlayer:
EventSource
forended
andpause
events.
- goal: a stream of
- sinks
- state: a reducer stream.
- status: a stream of action status.
- result: a stream of action results.
- AudioPlayer: a stream for
AudioPlayer
driver input.
HTML Audio driver factory.
-
Driver the HTML Audio Cycle.js driver function. It takes a stream of objects containing
[src](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#attr-src).org/en-US/docs/Web/API/SpeechSynthesisUtterance#Properties)
fieldand returns aEventSource
:EventSource.events(eventName)
returns a stream ofeventName
events fromHTML Audio/Video Events
.