
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
cycle-html5-audio-driver
Advanced tools
A cycle.js driver based on the html5 audio element for playing sounds
A cycle.js driver based on the html5 audio element for playing sounds.
npm install --save cycle-html5-audio-driver
The audio driver expects a stream of arrays containing objects of two keys: soundPath: A string path to a sound file (local or external) toPlay: A boolean value representing whether the sound should be played or not
import { run } from '@cycle/run';
import xs from 'xstream';
import { makeAudioDriver } from 'cycle-html5-audio-driver';
const main = (sources) => {
...
return {
audio: xs.of([
{
soundPath: 'path/to/my/audio/file.mp3',
toPlay: true, // Will be played completely
},
{
soundPath: 'path/to/other/audio/file.wav',
toPlay: false, // Will not start util it is passed true again,
// but will continue playing
},
]),
}
};
run(main, { audio: makeAudioDriver() });
Each object in the sounds array emmited via the audio sink will produce a sound for its total duration. A sound cannot be stopped and only replayed.
This happens when it has been reset to false and then true again.
The driver was created for a personal project that served the goal to experiment with cycle.js. It is a simple javascript piano playing sounds when the keys are pressed.
See the project on Github: Reactive piano
The driver is really simple and may not be used in production applications. It only produces write effects (playing sounds) and doesn't retrieve any feedback (read effects). Please feel free to improve upon this package and to send PRs but do not expect too much of it. :)
FAQs
A cycle.js driver based on the html5 audio element for playing sounds
We found that cycle-html5-audio-driver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.