av
Advanced tools
Comparing version 0.4.6 to 0.4.7
{ | ||
"name": "av", | ||
"description": "Audio decoding framework", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"author": { | ||
@@ -9,3 +9,3 @@ "name": "Audiocogs", | ||
}, | ||
"license":"MIT", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -12,0 +12,0 @@ "type": "git", |
@@ -50,4 +50,4 @@ // Generated by CoffeeScript 1.7.1 | ||
Asset.fromURL = function(url) { | ||
return new Asset(new HTTPSource(url)); | ||
Asset.fromURL = function(url, opts) { | ||
return new Asset(new HTTPSource(url, opts)); | ||
}; | ||
@@ -54,0 +54,0 @@ |
@@ -69,3 +69,3 @@ // Generated by CoffeeScript 1.7.1 | ||
var error, offset, packet; | ||
this.waiting = false; | ||
this.waiting = !this.receivedFinalBuffer; | ||
offset = this.bitstream.offset(); | ||
@@ -83,2 +83,5 @@ try { | ||
this.emit('data', packet); | ||
if (this.receivedFinalBuffer) { | ||
this.emit('end'); | ||
} | ||
return true; | ||
@@ -85,0 +88,0 @@ } else if (!this.receivedFinalBuffer) { |
@@ -38,3 +38,2 @@ // Generated by CoffeeScript 1.7.1 | ||
this.buffer = null; | ||
this.arr = null; | ||
this.currentFrame = 0; | ||
@@ -49,7 +48,5 @@ this.ended = false; | ||
var arr, buffer, frame, len, offset, _i, _len; | ||
arr = this.arr, buffer = this.buffer; | ||
buffer = this.buffer; | ||
len = n / 4; | ||
if ((arr != null ? arr.length : void 0) !== len) { | ||
this.arr = arr = new Float32Array(len); | ||
} | ||
arr = new Float32Array(len); | ||
this.emit('refill', arr); | ||
@@ -56,0 +53,0 @@ if (this.ended) { |
@@ -71,4 +71,4 @@ // Generated by CoffeeScript 1.7.1 | ||
Player.fromURL = function(url) { | ||
return new Player(Asset.fromURL(url)); | ||
Player.fromURL = function(url, opts) { | ||
return new Player(Asset.fromURL(url, opts)); | ||
}; | ||
@@ -75,0 +75,0 @@ |
@@ -14,6 +14,10 @@ // Generated by CoffeeScript 1.7.1 | ||
function HTTPSource(url) { | ||
function HTTPSource(url, opts) { | ||
this.url = url; | ||
this.opts = opts != null ? opts : {}; | ||
this.chunkSize = 1 << 20; | ||
this.inflight = false; | ||
if (this.opts.length) { | ||
this.length = this.opts.length; | ||
} | ||
this.reset(); | ||
@@ -20,0 +24,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
230700
3647