Permalink
Browse files

Updated readme

  • Loading branch information...
1 parent 273552e commit a935d768fdddf21457ee43026f5884c4f576f2cd @jussi-kalliokoski committed Aug 8, 2011
Showing with 7 additions and 14 deletions.
  1. +7 −14 readme.md
View
@@ -3,31 +3,23 @@ audiolib.js
audiolib.js is a powerful audio tools library for javascript.
-Amongst other things, it provides AudioDevice class which has a consistent callback API that supports both Firefox4's Audio Data API and Chrome 10's Web Audio API.
+Amongst other things, it's bundled with [sink.js](https://github.com/jussi-kalliokoski/sink.js) that provides a Sink class which has a consistent callback audio output API that supports both Firefox4's Audio Data API and Chrome 10's Web Audio API.
Usage
-----
```javascript
-// Create a device.
-var dev = audioLib.AudioDevice(function(sampleBuffer){
+// Create an output.
+var dev = audioLib.Sink(function(sampleBuffer){
// Fill the buffer here.
}, channelCount, preBufferSize, sampleRate);
// Note that all the arguments are optional, so if you want to create a write-only device, you can leave the arguments blank.
// Writing buffers:
dev.writeBuffer(buffer);
-// Or create a scheduled AudioDevice
-var dev = audioLib.AudioDevice.createScheduled(/* same arguments as for the normal AudioDevice call */);
-
-// Schedule an event
-dev.schedule(function(){
- // do something, change oscillator frequency, whatever, see ./tests/scheduling.html for an example.
-});
-
-// If you want your application to work as a background tab in Firefox 4, do this before creating the device:
-audioLib.AudioDevice.devices.moz.backgroundWork = true;
+// If you want your application to work as a background tab in Firefox 5+, do this before creating the device:
+audioLib.Sink.backgroundWork = true;
// Effects
@@ -120,7 +112,7 @@ You can also use audiolib.js inside Audio Workers (Firefox 6.0+ only), but this
```javascript
var worker = audioLib.AudioWorker(function(){
- device = audioLib.AudioDevice(function(buffer, channelCount){
+ device = audioLib.Sink(function(buffer, channelCount){
// Do some audio processing, like you weren't in a worker.
});
}, true /* enables injections */);
@@ -163,6 +155,7 @@ Demos
Libraries bundled with audiolib.js
----------------------------------
+* [sink.js](https://github.com/jussi-kalliokoski/sink.js), for output and buffer handling.
* [PCMData.js](https://github.com/jussi-kalliokoski/pcmdata.js), for WAV codecs.
* [binary.js](https://github.com/jussi-kalliokoski/binary.js), for PCMData.js and general binary data processing.
* [fft.js](https://github.com/jussi-kalliokoski/fft.js), for super fast FT.

0 comments on commit a935d76

Please sign in to comment.