pcm.js
pcm.js copied to clipboard
ReferenceError: Audio is not defined
just your example @ nodejs
pcm = require('pcmjs')
var sine = [];
for (var i=0; i<10000; i++) {
sine[i] = 128+Math.round(127*Math.sin(i/5));
}
new pcm({channels: 1, rate: 8000, depth: 8}).toWav(sine).play();
var dataURI = new pcm({channels: 1, rate: 8000, depth: 8}).toWav(sine).encode();
Audio is the actual html5 audio element which is obviously not supported within node. This is used only for playback, and should throw an error.
This is expected but maybe I should augment the readme in that sense.