pico.js
Audio processor for the cross-platform
Support
Support | API | |
---|---|---|
Google Chrome 10+ | ⭕️ | Web Audio API |
Firefox 25+ | ⭕️ | Web Audio API |
Safari 6+ | ⭕️ | Web Audio API |
Opera 15+ | ⭕️ | Web Audio API |
Internet Explorer 10 | ⭕️ | Flash fallback |
Node.js 0.10 | ⭕️ | node-speaker |
Installation
npm:
npm install node-pico
bower:
bower install pico.js
downloads:
- pico.js
- pico.min.js
- pico.swf - must be put in the same directory with the pico.js.
API
Pico.play(audioprocess: function): void
Pico.pause(): void
Pico.sampleRate: number
Pico.bufferSize: number
Pico.isPlaying: boolean
Example
var Pico = ; { var x1 = 0 y1 = 440 / PicosampleRate; var x2 = 0 y2 = 442 / PicosampleRate; return { var out = ebuffers; for var i = 0; i < ebufferSize; i++ out0i = Math * 025; out1i = Math * 025; x1 += y1; x2 += y2; };} Pico; ;
How to play other examples on node.js
$ npm install .
$ npm run build
$ node examples
Development
build: 6to5 -> browserify -> uglify
npm run build
test: mocha
npm run test
coverage: istanbul
npm run cover
lint: jshint
npm run lint