jsynth-file-sample

test audioBufferSource node for web audio API

jsynth-file-sample

This module will turn your audio file / clip into a Web Audio source node. Use it to create samples.

Use with browserifyv.2 and brfs

npm install jsynth-file-sample

example.js - use fs.readFileSync as supported by brfs. Use base64 encoding.

var fs = require('fs')
,   fileBuff = require('./')
,   context = new webkitAudioContext()
;
 
var file = fs.readFileSync('./loop.wav', 'base64'); // <----   
 
var sample = fileBuff(context, file);
 
sample.loop = true;
 
sample.connect(context.destination)
 
sample.start(0)

To run example.js

npm install -g browserify -opa
git clone https://github.com/NHQ/jsynth-file-sample 
cd jsynth-file-sample
opa --e example.js