Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including neat-audio with all npm packages installed. Try it out:

var neatAudio = require("neat-audio")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

neat-audio v0.2.1

A simple, neat promise wrapper for the web Audio Context API. Get and play sounds from urls with ease.


A simple, neat promise wrapper for the web Audio Context API, designed for use with browserify. Get and play sounds from urls with ease.


You'll need to use a Promise pattern with neatAudio, since it returns promises.

Fetch a Sound

var neatAudio = require('neat-audio');

// Init neatAudio

// Load the sound buffers into variable
neatAudio.fetchSound('willhelm_scream.wav').then(function(soundBuffer) {
  var scream = soundBuffer;

  // Play the sound
}).catch(function(err) {
  console.error('Could not fetch sound!', err);

Fetch Multiple Sounds

var neatAudio = require('neat-audio');
var Promise = require('es6-promise'); // or some other promise lib/polyfill

// Init neatAudio

// Declare some variables to look after your sound buffers
var sounds = {
  click: null,
  shick: null,
  boom: null

// Load the sound buffers into local variables
]).then(function(values) { = values[0];
  sounds.shick = values[1];
  sounds.boom = values[2];

  // Playing any of them


  • [ ] Modify project to show browserify bundling
  • [ ] Test with browser window
  • [ ] Add tests for getting and playing sounds
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free