Skip to content

Commit

Permalink
AudioSampleLoader no longer requires existing AudioContext in ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottMichaud committed Mar 13, 2015
1 parent b758de7 commit 4f40d5e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions AudioSampleLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Basically, imagine it like XMLHttpRequest for loading WebAudio samples.
*
* @author Scott Michaud
* @version 0.1
* @version 0.2
*/

function AudioSampleLoader() {
Expand All @@ -33,11 +33,9 @@ AudioSampleLoader.prototype.send = function () {
var console = window.console,
i;
if (!this.hasOwnProperty('ctx')) {
//TODO: Consider making optional: use new ctx, no error.
console.error('AudioSampleLoader: AudioContext ctx does not exist');
return;
this.ctx = new window.AudioContext();
} else if (!(this.ctx instanceof window.AudioContext)) {
//TODO: Consider posting an error and using a new ctx.
//TODO: Post an error, but do not overwrite the variable with a valid context.
console.error('AudioSampleLoader: ctx not an instance of AudioContext');
return;
}
Expand Down

0 comments on commit 4f40d5e

Please sign in to comment.