diff --git a/README.md b/README.md index 3830a91d..786ed8e2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Recorder.js +# Recorder.js ## A plugin for recording/exporting the output of Web Audio API nodes @@ -18,6 +18,8 @@ Creates a recorder instance. - **bufferLen** - The length of the buffer that the internal JavaScriptNode uses to capture the audio. Can be tweaked if experiencing performance issues. Defaults to 4096. - **callback** - A default callback to be used with `exportWAV`. - **type** - The type of the Blob generated by `exportWAV`. Defaults to 'audio/wav'. +- **sampleRate** - The sample rate. +- **numChannels** - Determines whether audio is mono (1) or stereo (2). Defaults to 2. --------- #### Instance Methods diff --git a/dist/recorder.js b/dist/recorder.js index 42a6ad0f..5b1b8215 100644 --- a/dist/recorder.js +++ b/dist/recorder.js @@ -259,7 +259,7 @@ /* sample rate */ view.setUint32(24, sampleRate, true); /* byte rate (sample rate * block align) */ - view.setUint32(28, sampleRate * 4, true); + view.setUint32(28, sampleRate * numChannels * 2, true); /* block align (channel count * bytes per sample) */ view.setUint16(32, numChannels * 2, true); /* bits per sample */ diff --git a/examples/example_simple_exportwav.html b/examples/example_simple_exportwav.html index a28bda64..bd82c7f5 100644 --- a/examples/example_simple_exportwav.html +++ b/examples/example_simple_exportwav.html @@ -86,7 +86,7 @@