pcm.js icon indicating copy to clipboard operation
pcm.js copied to clipboard

ReferenceError: Audio is not defined

Open vird opened this issue 10 years ago • 1 comments

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();

vird avatar Oct 01 '15 17:10 vird

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.

pdeschen avatar Oct 01 '15 17:10 pdeschen