troloop

test audioBufferSource node for web audio API

npm install troloop
4 downloads in the last week
16 downloads in the last month

troloop

An html5 Web Audio bufferSource Node, for testing purposes. The node will play a 17 second track converted from a base64 encoded wav file (included). You can connect it to any other web audio node, including webaudio nodes

This module is for use with Browserify

usage

var audioContext = new webkitAudioContext();
var troloop = require('troloop');

audioSourceBuffer = troloop(context)

audioSourceBuffer.start(0)

or use it with webaudio

var webaudio = require('webaudio');
var audioContext = new webkitAudioContext();
var troloop = require('./');
var amod = require('amod');
var audioSourceBuffer = troloop(audioContext)

function wubwub(time, i, sample){
    return sample * amod(.5, .4, time, .5)
}

var wubNode = webaudio(audioContext, wubwub);

audioSourceBuffer.connect(wubNode)

wubNode.connect(audioContext.destination)

audioSourceBuffer.start(0)
npm loves you