Skip to content

Commit

Permalink
Merge pull request #37 from varenc/fix-worker-mic-example.html
Browse files Browse the repository at this point in the history
Fix audio being cut off in mic.html worker example
  • Loading branch information
geeee committed May 6, 2017
2 parents c318d57 + 15b127f commit 17635f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion worker-example/mic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
function beginRecording(stream) {
// Set up Web Audio API to process data from the media stream (microphone).
microphone = context.createMediaStreamSource(stream);
processor = context.createScriptProcessor(16384, 1, 1);
// Settings a bufferSize of 0 instructs the browser to choose the best bufferSize
processor = context.createScriptProcessor(0, 1, 1);
// Add all buffers from LAME into an array.
processor.onaudioprocess = function (event) {
// Send microphone data to LAME for MP3 encoding while recording.
Expand Down

0 comments on commit 17635f6

Please sign in to comment.