Skip to content

Instantly share code, notes, and snippets.

@notmasteryet
Created March 12, 2011 04:46
Show Gist options
  • Save notmasteryet/867036 to your computer and use it in GitHub Desktop.
Save notmasteryet/867036 to your computer and use it in GitHub Desktop.
--- a/Audiolet.js 2011-03-11 22:44:58.856274000 -0600
+++ b/Audiolet.js 2011-03-11 22:44:02.196274002 -0600
@@ -213,16 +213,17 @@
},
tick: function() {
var outputPosition = this.output.mozCurrentSampleOffset();
// Check if some data was not written in previous attempts
var numSamplesWritten;
if (this.overflow) {
numSamplesWritten = this.output.mozWriteAudio(this.overflow);
+ if(numSamplesWritten === 0) return;
this.writePosition += numSamplesWritten;
if (numSamplesWritten < this.overflow.length) {
// Not all the data was written, saving the tail for writing
// the next time fillBuffer is called
this.overflow = this.overflow.subarray(numSamplesWritten);
return;
}
this.overflow = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment