Skip to content

Commit

Permalink
Pass reference to the recorder instance to callback
Browse files Browse the repository at this point in the history
  • Loading branch information
pauln committed Dec 5, 2014
1 parent 9d75cbf commit 3962738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>Log</h2>
<pre id="log"></pre>

<script>
function uploadAudio(mp3Data){
function uploadAudio(recorder, mp3Data){
var reader = new FileReader();
reader.onload = function(event){
var fd = new FormData();
Expand Down Expand Up @@ -62,7 +62,7 @@ <h2>Log</h2>
reader.readAsDataURL(mp3Data);

}
function logToConsole(data) {
function logToConsole(recorder, data) {
console.log(data);
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions js/recordmp3.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
self.convertToMP3();
} else {
// Assume WAV.
window[self.callback](self.audioData);
window[self.callback](self, self.audioData);
}
}

Expand Down Expand Up @@ -202,7 +202,7 @@
__log("Done converting to Mp3");

var mp3Blob = new Blob([new Uint8Array(e.data.buf)], {type: 'audio/mp3'});
window[self.callback](mp3Blob);
window[self.callback](self, mp3Blob);

}
};
Expand Down

0 comments on commit 3962738

Please sign in to comment.