Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed mergeAudioBuffers to a function declaration to preserve the name... #16

Merged
merged 1 commit into from
Feb 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
changed mergeAudioBuffers to a function declaration to preserve the n…
…ame during minification.
  • Loading branch information
jimlowrey committed Feb 10, 2015
commit 59ca77f7d0c8163533afac621c0c1fdf653187a1
7 changes: 4 additions & 3 deletions dev/StereoAudioRecorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function StereoAudioRecorder(mediaStream, config) {
};

function mergeLeftRightBuffers(config, callback) {
var webWorker = processInWebWorker(function mergeAudioBuffers(config) {
function mergeAudioBuffers(config) {
var leftBuffers = config.leftBuffers;
var rightBuffers = config.rightBuffers;
var sampleRate = config.sampleRate;
Expand Down Expand Up @@ -171,7 +171,8 @@ function StereoAudioRecorder(mediaStream, config) {
buffer: buffer,
view: view
});
});
}
var webWorker = processInWebWorker(mergeAudioBuffers);

webWorker.onmessage = function(event) {
callback(event.data.buffer, event.data.view);
Expand All @@ -182,7 +183,7 @@ function StereoAudioRecorder(mediaStream, config) {

function processInWebWorker(_function) {
var blob = URL.createObjectURL(new Blob([_function.toString(),
'this.onmessage = function (e) {mergeAudioBuffers(e.data);}'
'this.onmessage = function (e) {' + _function.name + '(e.data);}'
], {
type: 'application/javascript'
}));
Expand Down