mirror of https://github.com/kurisufriend/0x40-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
282 lines
141 KiB
282 lines
141 KiB
!function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self);b.AV=r()}}(function(){return function b(m,g,l){function a(d,h){if(!g[d]){if(!m[d]){var c="function"==typeof require&&require;if(!h&&c)return c(d,!0);if(e)return e(d,!0);throw Error("Cannot find module '"+d+"'");}c=g[d]={exports:{}};m[d][0].call(c.exports,
|
|
function(b){var k=m[d][1][b];return a(k?k:b)},c,c.exports,b,m,g,l)}return g[d].exports}for(var e="function"==typeof require&&require,d=0;d<l.length;d++)a(l[d]);return a}({1:[function(b,m,g){var l,a;a=b("./src/aurora");for(l in a)m=a[l],g[l]=m;b("./src/devices/webaudio");b("./src/devices/mozilla")},{"./src/aurora":3,"./src/devices/mozilla":22,"./src/devices/webaudio":24}],2:[function(b,m,g){var l,a,e,d,q,h=function(a,b){return function(){return a.apply(b,arguments)}},c={}.hasOwnProperty,x=function(a,
|
|
b){function h(){this.constructor=a}for(var d in b)c.call(b,d)&&(a[d]=b[d]);h.prototype=b.prototype;a.prototype=new h;a.__super__=b.prototype;return a};g=b("./core/events");q=b("./sources/node/http");d=b("./sources/node/file");l=b("./sources/buffer");e=b("./demuxer");a=b("./decoder");b=function(b){function c(a){this.source=a;this._decode=h(this._decode,this);this.findDecoder=h(this.findDecoder,this);this.probe=h(this.probe,this);this.buffered=0;this.metadata=this.format=this.duration=null;this.active=
|
|
!1;this.decoder=this.demuxer=null;this.source.once("data",this.probe);this.source.on("error",function(a){return function(b){a.emit("error",b);return a.stop()}}(this));this.source.on("progress",function(a){return function(b){a.buffered=b;return a.emit("buffer",a.buffered)}}(this))}x(c,b);c.fromURL=function(a){return new c(new q(a))};c.fromFile=function(a){return new c(new d(a))};c.fromBuffer=function(a){return new c(new l(a))};c.prototype.start=function(a){if(!this.active&&(null!=a&&(this.shouldDecode=
|
|
a),null==this.shouldDecode&&(this.shouldDecode=!0),this.active=!0,this.source.start(),this.decoder&&this.shouldDecode))return this._decode()};c.prototype.stop=function(){if(this.active)return this.active=!1,this.source.pause()};c.prototype.get=function(a,b){if("format"===a||"duration"===a||"metadata"===a){if(null!=this[a])return b(this[a]);this.once(a,function(a){return function(c){a.stop();return b(c)}}(this));return this.start()}};c.prototype.decodePacket=function(){return this.decoder.decode()};
|
|
c.prototype.decodeToBuffer=function(a){var b,c,k;k=0;b=[];this.on("data",c=function(a){k+=a.length;return b.push(a)});this.once("end",function(){var h,d,e,p,w;h=new Float32Array(k);p=e=0;for(w=b.length;p<w;p++)d=b[p],h.set(d,e),e+=d.length;this.off("data",c);return a(h)});return this.start()};c.prototype.probe=function(a){var b;if(this.active){b=e.find(a);if(!b)return this.emit("error","A demuxer for this container was not found.");this.demuxer=new b(this.source,a);this.demuxer.on("format",this.findDecoder);
|
|
this.demuxer.on("duration",function(a){return function(b){a.duration=b;return a.emit("duration",a.duration)}}(this));this.demuxer.on("metadata",function(a){return function(b){a.metadata=b;return a.emit("metadata",a.metadata)}}(this));return this.demuxer.on("error",function(a){return function(b){a.emit("error",b);return a.stop()}}(this))}};c.prototype.findDecoder=function(b){var c;this.format=b;if(this.active){this.emit("format",this.format);b=a.find(this.format.formatID);if(!b)return this.emit("error",
|
|
"A decoder for "+this.format.formatID+" was not found.");this.decoder=new b(this.demuxer,this.format);if(this.format.floatingPoint)this.decoder.on("data",function(a){return function(b){return a.emit("data",b)}}(this));else c=Math.pow(2,this.format.bitsPerChannel-1),this.decoder.on("data",function(a){return function(b){var k,h,d,p,t;k=new Float32Array(b.length);h=p=0;for(t=b.length;p<t;h=++p)d=b[h],k[h]=d/c;return a.emit("data",k)}}(this));this.decoder.on("error",function(a){return function(b){a.emit("error",
|
|
b);return a.stop()}}(this));this.decoder.on("end",function(a){return function(){return a.emit("end")}}(this));this.emit("decodeStart");if(this.shouldDecode)return this._decode()}};c.prototype._decode=function(){for(;this.decoder.decode()&&this.active;);if(this.active)return this.decoder.once("data",this._decode)};return c}(g);m.exports=b},{"./core/events":9,"./decoder":12,"./demuxer":15,"./sources/buffer":32,"./sources/node/file":30,"./sources/node/http":31}],3:[function(b,m,g){var l,a;a=b("./aurora_base");
|
|
for(l in a)m=a[l],g[l]=m;b("./demuxers/caf");b("./demuxers/m4a");b("./demuxers/aiff");b("./demuxers/wave");b("./demuxers/au");b("./decoders/lpcm");b("./decoders/xlaw")},{"./aurora_base":4,"./decoders/lpcm":13,"./decoders/xlaw":14,"./demuxers/aiff":16,"./demuxers/au":17,"./demuxers/caf":18,"./demuxers/m4a":19,"./demuxers/wave":20}],4:[function(b,m,g){g.Base=b("./core/base");g.Buffer=b("./core/buffer");g.BufferList=b("./core/bufferlist");g.Stream=b("./core/stream");g.Bitstream=b("./core/bitstream");
|
|
g.EventEmitter=b("./core/events");g.UnderflowError=b("./core/underflow");g.HTTPSource=b("./sources/node/http");g.FileSource=b("./sources/node/file");g.BufferSource=b("./sources/buffer");g.Demuxer=b("./demuxer");g.Decoder=b("./decoder");g.AudioDevice=b("./device");g.Asset=b("./asset");g.Player=b("./player");g.Filter=b("./filter");g.VolumeFilter=b("./filters/volume");g.BalanceFilter=b("./filters/balance")},{"./asset":2,"./core/base":5,"./core/bitstream":6,"./core/buffer":7,"./core/bufferlist":8,"./core/events":9,
|
|
"./core/stream":10,"./core/underflow":11,"./decoder":12,"./demuxer":15,"./device":21,"./filter":25,"./filters/balance":26,"./filters/volume":27,"./player":28,"./sources/buffer":32,"./sources/node/file":30,"./sources/node/http":31}],5:[function(b,m,g){var l={}.hasOwnProperty,a=function(a,b){function h(){this.constructor=a}for(var c in b)l.call(b,c)&&(a[c]=b[c]);h.prototype=b.prototype;a.prototype=new h;a.__super__=b.prototype;return a},e=[].indexOf||function(a){for(var b=0,h=this.length;b<h;b++)if(b in
|
|
this&&this[b]===a)return b;return-1};b=function(){function b(){}var q;q=/\b_super\b/;b.extend=function(b){var c,d,k,w,t,u;c=function(b){function c(){return c.__super__.constructor.apply(this,arguments)}a(c,b);return c}(this);if("function"===typeof b)for(k in w=Object.keys(c.prototype),b.call(c,c),b={},t=c.prototype,t)d=t[k],0>e.call(w,k)&&(b[k]=d);u=c.__super__;for(k in b)d=b[k],"function"===typeof d&&q.test(d)?function(a,b){return c.prototype[a]=function(){var c,k;k=this._super;this._super=u[a];
|
|
c=b.apply(this,arguments);this._super=k;return c}}(k,d):c.prototype[k]=d;return c};return b}();m.exports=b},{}],6:[function(b,m,g){b=function(){function b(a){this.stream=a;this.bitPosition=0}b.prototype.copy=function(){var a;a=new b(this.stream.copy());a.bitPosition=this.bitPosition;return a};b.prototype.offset=function(){return 8*this.stream.offset+this.bitPosition};b.prototype.available=function(a){return this.stream.available((a+8-this.bitPosition)/8)};b.prototype.advance=function(a){a=this.bitPosition+
|
|
a;this.stream.advance(a>>3);return this.bitPosition=a&7};b.prototype.rewind=function(a){a=this.bitPosition-a;this.stream.rewind(Math.abs(a>>3));return this.bitPosition=a&7};b.prototype.seek=function(a){var b;b=this.offset();if(a>b)return this.advance(a-b);if(a<b)return this.rewind(b-a)};b.prototype.align=function(){if(0!==this.bitPosition)return this.bitPosition=0,this.stream.advance(1)};b.prototype.read=function(a,b){var d,q,h,c,x,k;if(0===a)return 0;k=a+this.bitPosition;if(8>=k)d=(this.stream.peekUInt8()<<
|
|
this.bitPosition&255)>>>8-a;else if(16>=k)d=(this.stream.peekUInt16()<<this.bitPosition&65535)>>>16-a;else if(24>=k)d=(this.stream.peekUInt24()<<this.bitPosition&16777215)>>>24-a;else if(32>=k)d=this.stream.peekUInt32()<<this.bitPosition>>>32-a;else if(40>=k)d=4294967296*this.stream.peekUInt8(0),q=this.stream.peekUInt8(1)<<24>>>0,h=this.stream.peekUInt8(2)<<16,c=this.stream.peekUInt8(3)<<8,x=this.stream.peekUInt8(4),d=(d+q+h+c+x)%Math.pow(2,40-this.bitPosition),d=Math.floor(d/Math.pow(2,40-this.bitPosition-
|
|
a));else throw Error("Too many bits!");b&&(32>k?d>>>a-1&&(d=-1*((1<<a>>>0)-d)):d/Math.pow(2,a-1)|0&&(d=-1*(Math.pow(2,a)-d)));this.advance(a);return d};b.prototype.peek=function(a,b){var d,q,h,c,x,k;if(0===a)return 0;k=a+this.bitPosition;if(8>=k)d=(this.stream.peekUInt8()<<this.bitPosition&255)>>>8-a;else if(16>=k)d=(this.stream.peekUInt16()<<this.bitPosition&65535)>>>16-a;else if(24>=k)d=(this.stream.peekUInt24()<<this.bitPosition&16777215)>>>24-a;else if(32>=k)d=this.stream.peekUInt32()<<this.bitPosition>>>
|
|
32-a;else if(40>=k)d=4294967296*this.stream.peekUInt8(0),q=this.stream.peekUInt8(1)<<24>>>0,h=this.stream.peekUInt8(2)<<16,c=this.stream.peekUInt8(3)<<8,x=this.stream.peekUInt8(4),d=(d+q+h+c+x)%Math.pow(2,40-this.bitPosition),d=Math.floor(d/Math.pow(2,40-this.bitPosition-a));else throw Error("Too many bits!");b&&(32>k?d>>>a-1&&(d=-1*((1<<a>>>0)-d)):d/Math.pow(2,a-1)|0&&(d=-1*(Math.pow(2,a)-d)));return d};b.prototype.readLSB=function(a,b){var d,q;if(0===a)return 0;if(40<a)throw Error("Too many bits!");
|
|
q=a+this.bitPosition;d=this.stream.peekUInt8(0)>>>this.bitPosition;8<q&&(d|=this.stream.peekUInt8(1)<<8-this.bitPosition);16<q&&(d|=this.stream.peekUInt8(2)<<16-this.bitPosition);24<q&&(d+=this.stream.peekUInt8(3)<<24-this.bitPosition>>>0);32<q&&(d+=this.stream.peekUInt8(4)*Math.pow(2,32-this.bitPosition));d=32<=q?d%Math.pow(2,a):d&(1<<a)-1;b&&(32>q?d>>>a-1&&(d=-1*((1<<a>>>0)-d)):d/Math.pow(2,a-1)|0&&(d=-1*(Math.pow(2,a)-d)));this.advance(a);return d};b.prototype.peekLSB=function(a,b){var d,q;if(0===
|
|
a)return 0;if(40<a)throw Error("Too many bits!");q=a+this.bitPosition;d=this.stream.peekUInt8(0)>>>this.bitPosition;8<q&&(d|=this.stream.peekUInt8(1)<<8-this.bitPosition);16<q&&(d|=this.stream.peekUInt8(2)<<16-this.bitPosition);24<q&&(d+=this.stream.peekUInt8(3)<<24-this.bitPosition>>>0);32<q&&(d+=this.stream.peekUInt8(4)*Math.pow(2,32-this.bitPosition));d=32<=q?d%Math.pow(2,a):d&(1<<a)-1;b&&(32>q?d>>>a-1&&(d=-1*((1<<a>>>0)-d)):d/Math.pow(2,a-1)|0&&(d=-1*(Math.pow(2,a)-d)));return d};return b}();
|
|
m.exports=b},{}],7:[function(b,m,g){(function(b){var a;a=function(){function a(h){var c;if(h instanceof Uint8Array)this.data=h;else if(h instanceof ArrayBuffer||Array.isArray(h)||"number"===typeof h||null!=(c=b.Buffer)&&c.isBuffer(h))this.data=new Uint8Array(h);else if(h.buffer instanceof ArrayBuffer)this.data=new Uint8Array(h.buffer,h.byteOffset,h.length*h.BYTES_PER_ELEMENT);else if(h instanceof a)this.data=h.data;else throw Error("Constructing buffer with unknown type.");this.length=this.data.length;
|
|
this.prev=this.next=null}var d,q;a.allocate=function(b){return new a(b)};a.prototype.copy=function(){return new a(new Uint8Array(this.data))};a.prototype.slice=function(b,c){null==c&&(c=this.length);return 0===b&&c>=this.length?new a(this.data):new a(this.data.subarray(b,b+c))};d=b.BlobBuilder||b.MozBlobBuilder||b.WebKitBlobBuilder;q=b.URL||b.webkitURL||b.mozURL;a.makeBlob=function(a,b){var q;null==b&&(b="application/octet-stream");try{return new Blob([a],{type:b})}catch(k){}return null!=d?(q=new d,
|
|
q.append(a),q.getBlob(b)):null};a.makeBlobURL=function(a,b){return null!=q?q.createObjectURL(this.makeBlob(a,b)):void 0};a.revokeBlobURL=function(a){return null!=q?q.revokeObjectURL(a):void 0};a.prototype.toBlob=function(){return a.makeBlob(this.data.buffer)};a.prototype.toBlobURL=function(){return a.makeBlobURL(this.data.buffer)};return a}();m.exports=a}).call(this,"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],8:[function(b,m,g){b=function(){function b(){this.last=this.first=
|
|
null;this.availableBuffers=this.availableBytes=this.numBuffers=0}b.prototype.copy=function(){var a;a=new b;a.first=this.first;a.last=this.last;a.numBuffers=this.numBuffers;a.availableBytes=this.availableBytes;a.availableBuffers=this.availableBuffers;return a};b.prototype.append=function(a){var b;a.prev=this.last;null!=(b=this.last)&&(b.next=a);this.last=a;null==this.first&&(this.first=a);this.availableBytes+=a.length;this.availableBuffers++;return this.numBuffers++};b.prototype.advance=function(){return this.first?
|
|
(this.availableBytes-=this.first.length,this.availableBuffers--,this.first=this.first.next,null!=this.first):!1};b.prototype.rewind=function(){var a;if(this.first&&!this.first.prev)return!1;if(this.first=(null!=(a=this.first)?a.prev:void 0)||this.last)this.availableBytes+=this.first.length,this.availableBuffers++;return null!=this.first};b.prototype.reset=function(){for(;this.rewind(););return[]};return b}();m.exports=b},{}],9:[function(b,m,g){var l={}.hasOwnProperty,a=function(a,b){function h(){this.constructor=
|
|
a}for(var c in b)l.call(b,c)&&(a[c]=b[c]);h.prototype=b.prototype;a.prototype=new h;a.__super__=b.prototype;return a},e=[].slice;b=function(b){function q(){return q.__super__.constructor.apply(this,arguments)}a(q,b);q.prototype.on=function(a,b){var d;null==this.events&&(this.events={});null==(d=this.events)[a]&&(d[a]=[]);return this.events[a].push(b)};q.prototype.off=function(a,b){var d;if(null!=(d=this.events)&&d[a]&&(d=this.events[a].indexOf(b),~d))return this.events[a].splice(d,1)};q.prototype.once=
|
|
function(a,b){var d;return this.on(a,d=function(){this.off(a,d);return b.apply(this,arguments)})};q.prototype.emit=function(){var a,b,d,k,w;b=arguments[0];a=2<=arguments.length?e.call(arguments,1):[];if(null!=(d=this.events)&&d[b])for(w=this.events[b].slice(),d=0,k=w.length;d<k;d++)b=w[d],b.apply(this,a)};return q}(b("./base"));m.exports=b},{"./base":5}],10:[function(b,m,g){var l,a,e;a=b("./bufferlist");l=b("./buffer");e=b("./underflow");b=function(){function b(a){this.list=a;this.offset=this.localOffset=
|
|
0}var q,h,c,x,k,w,t,u,H,A,M,n,v;q=new ArrayBuffer(16);v=new Uint8Array(q);H=new Int8Array(q);M=new Uint16Array(q);t=new Int16Array(q);n=new Uint32Array(q);u=new Int32Array(q);c=new Float32Array(q);"undefined"!==typeof Float64Array&&null!==Float64Array&&(x=new Float64Array(q));A=13330===(new Uint16Array((new Uint8Array([18,52])).buffer))[0];b.fromBuffer=function(c){var k;k=new a;k.append(c);return new b(k)};b.prototype.copy=function(){var a;a=new b(this.list.copy());a.localOffset=this.localOffset;
|
|
a.offset=this.offset;return a};b.prototype.available=function(a){return a<=this.list.availableBytes-this.localOffset};b.prototype.remainingBytes=function(){return this.list.availableBytes-this.localOffset};b.prototype.advance=function(a){if(!this.available(a))throw new e;this.localOffset+=a;for(this.offset+=a;this.list.first&&this.localOffset>=this.list.first.length;)this.localOffset-=this.list.first.length,this.list.advance();return this};b.prototype.rewind=function(a){if(a>this.offset)throw new e;
|
|
this.list.first||(this.list.rewind(),this.localOffset=this.list.first.length);this.localOffset-=a;for(this.offset-=a;this.list.first.prev&&0>this.localOffset;)this.list.rewind(),this.localOffset+=this.list.first.length;return this};b.prototype.seek=function(a){if(a>this.offset)return this.advance(a-this.offset);if(a<this.offset)return this.rewind(this.offset-a)};b.prototype.readUInt8=function(){var a;if(!this.available(1))throw new e;a=this.list.first.data[this.localOffset];this.localOffset+=1;this.offset+=
|
|
1;this.localOffset===this.list.first.length&&(this.localOffset=0,this.list.advance());return a};b.prototype.peekUInt8=function(a){var b;null==a&&(a=0);if(!this.available(a+1))throw new e;a=this.localOffset+a;for(b=this.list.first;b;){if(b.length>a)return b.data[a];a-=b.length;b=b.next}return 0};b.prototype.read=function(a,b){var c,k;null==b&&(b=!1);if(b===A)for(c=k=0;k<a;c=k+=1)v[c]=this.readUInt8();else for(c=k=a-1;0<=k;c=k+=-1)v[c]=this.readUInt8()};b.prototype.peek=function(a,b,c){var k;null==
|
|
c&&(c=!1);if(c===A)for(c=k=0;k<a;c=k+=1)v[c]=this.peekUInt8(b+c);else for(c=k=0;k<a;c=k+=1)v[a-c-1]=this.peekUInt8(b+c)};b.prototype.readInt8=function(){this.read(1);return H[0]};b.prototype.peekInt8=function(a){null==a&&(a=0);this.peek(1,a);return H[0]};b.prototype.readUInt16=function(a){this.read(2,a);return M[0]};b.prototype.peekUInt16=function(a,b){null==a&&(a=0);this.peek(2,a,b);return M[0]};b.prototype.readInt16=function(a){this.read(2,a);return t[0]};b.prototype.peekInt16=function(a,b){null==
|
|
a&&(a=0);this.peek(2,a,b);return t[0]};b.prototype.readUInt24=function(a){return a?this.readUInt16(!0)+(this.readUInt8()<<16):(this.readUInt16()<<8)+this.readUInt8()};b.prototype.peekUInt24=function(a,b){null==a&&(a=0);return b?this.peekUInt16(a,!0)+(this.peekUInt8(a+2)<<16):(this.peekUInt16(a)<<8)+this.peekUInt8(a+2)};b.prototype.readInt24=function(a){return a?this.readUInt16(!0)+(this.readInt8()<<16):(this.readInt16()<<8)+this.readUInt8()};b.prototype.peekInt24=function(a,b){null==a&&(a=0);return b?
|
|
this.peekUInt16(a,!0)+(this.peekInt8(a+2)<<16):(this.peekInt16(a)<<8)+this.peekUInt8(a+2)};b.prototype.readUInt32=function(a){this.read(4,a);return n[0]};b.prototype.peekUInt32=function(a,b){null==a&&(a=0);this.peek(4,a,b);return n[0]};b.prototype.readInt32=function(a){this.read(4,a);return u[0]};b.prototype.peekInt32=function(a,b){null==a&&(a=0);this.peek(4,a,b);return u[0]};b.prototype.readFloat32=function(a){this.read(4,a);return c[0]};b.prototype.peekFloat32=function(a,b){null==a&&(a=0);this.peek(4,
|
|
a,b);return c[0]};b.prototype.readFloat64=function(a){this.read(8,a);return x?x[0]:k()};k=function(){var a,b,c,k;c=n[0];b=n[1];if(!b||2147483648===b)return 0;k=1-2*(b>>>31);a=b>>>20&2047;b&=1048575;if(2047===a)return b?NaN:Infinity*k;a-=1023;b=(b|1048576)*Math.pow(2,a-20);b+=c*Math.pow(2,a-52);return k*b};b.prototype.peekFloat64=function(a,b){null==a&&(a=0);this.peek(8,a,b);return x?x[0]:k()};b.prototype.readFloat80=function(a){this.read(10,a);return w()};w=function(){var a,b,c,k,h;c=n[0];k=n[1];
|
|
a=v[9];b=v[8];h=1-2*(a>>>7);a=(a&127)<<8|b;if(0===a&&0===k&&0===c)return 0;if(32767===a)return 0===k&&0===c?Infinity*h:NaN;a-=16383;k*=Math.pow(2,a-31);k+=c*Math.pow(2,a-63);return h*k};b.prototype.peekFloat80=function(a,b){null==a&&(a=0);this.peek(10,a,b);return w()};b.prototype.readBuffer=function(a){var b,c,k,h;c=l.allocate(a);k=c.data;for(b=h=0;h<a;b=h+=1)k[b]=this.readUInt8();return c};b.prototype.peekBuffer=function(a,b){var c,k,h,d;null==a&&(a=0);k=l.allocate(b);h=k.data;for(c=d=0;d<b;c=d+=
|
|
1)h[c]=this.peekUInt8(a+c);return k};b.prototype.readSingleBuffer=function(a){a=this.list.first.slice(this.localOffset,a);this.advance(a.length);return a};b.prototype.peekSingleBuffer=function(a,b){return this.list.first.slice(this.localOffset+a,b)};b.prototype.readString=function(a,b){null==b&&(b="ascii");return h.call(this,0,a,b,!0)};b.prototype.peekString=function(a,b,c){null==a&&(a=0);null==c&&(c="ascii");return h.call(this,a,b,c,!1)};h=function(a,b,c,k){var h,d,t,A,w,q,e,u;c=c.toLowerCase();
|
|
e=null===b?0:-1;null==b&&(b=Infinity);q=a+b;u="";switch(c){case "ascii":case "latin1":for(;a<q&&(w=this.peekUInt8(a++))!==e;)u+=String.fromCharCode(w);break;case "utf8":case "utf-8":for(;a<q&&(h=this.peekUInt8(a++))!==e;)0===(h&128)?u+=String.fromCharCode(h):192===(h&224)?(d=this.peekUInt8(a++)&63,u+=String.fromCharCode((h&31)<<6|d)):224===(h&240)?(d=this.peekUInt8(a++)&63,t=this.peekUInt8(a++)&63,u+=String.fromCharCode((h&15)<<12|d<<6|t)):240===(h&248)&&(d=this.peekUInt8(a++)&63,t=this.peekUInt8(a++)&
|
|
63,b=this.peekUInt8(a++)&63,d=((h&15)<<18|d<<12|t<<6|b)-65536,u+=String.fromCharCode(55296+(d>>10),56320+(d&1023)));break;case "utf16-be":case "utf16be":case "utf16le":case "utf16-le":case "utf16bom":case "utf16-bom":switch(c){case "utf16be":case "utf16-be":d=!1;break;case "utf16le":case "utf16-le":d=!0;break;case "utf16bom":case "utf16-bom":if(2>b||(A=this.peekUInt16(a))===e)return k&&this.advance(a+2),u;d=65534===A;a+=2}for(;a<q&&(t=this.peekUInt16(a,d))!==e;)if(a+=2,55296>t||57343<t)u+=String.fromCharCode(t);
|
|
else{if(56319<t)throw Error("Invalid utf16 sequence.");h=this.peekUInt16(a,d);if(56320>h||57343<h)throw Error("Invalid utf16 sequence.");u+=String.fromCharCode(t,h);a+=2}t===e&&(a+=2);break;default:throw Error("Unknown encoding: "+c);}k&&this.advance(a);return u};return b}();m.exports=b},{"./buffer":7,"./bufferlist":8,"./underflow":11}],11:[function(b,m,g){var l={}.hasOwnProperty,a=function(a,b){function q(){this.constructor=a}for(var h in b)l.call(b,h)&&(a[h]=b[h]);q.prototype=b.prototype;a.prototype=
|
|
new q;a.__super__=b.prototype;return a};b=function(b){function d(){d.__super__.constructor.apply(this,arguments);this.name="UnderflowError";this.stack=Error().stack}a(d,b);return d}(Error);m.exports=b},{}],12:[function(b,m,g){var l,a,e,d,q={}.hasOwnProperty,h=function(a,b){function k(){this.constructor=a}for(var h in b)q.call(b,h)&&(a[h]=b[h]);k.prototype=b.prototype;a.prototype=new k;a.__super__=b.prototype;return a};g=b("./core/events");a=b("./core/bufferlist");e=b("./core/stream");l=b("./core/bitstream");
|
|
d=b("./core/underflow");b=function(b){function q(b,c){var k;this.demuxer=b;this.format=c;k=new a;this.stream=new e(k);this.bitstream=new l(this.stream);this.waiting=this.receivedFinalBuffer=!1;this.demuxer.on("cookie",function(a){return function(b){try{return a.setCookie(b)}catch(c){return a.emit("error",c)}}}(this));this.demuxer.on("data",function(a){return function(b){k.append(b);if(a.waiting)return a.decode()}}(this));this.demuxer.on("end",function(a){return function(){a.receivedFinalBuffer=!0;
|
|
if(a.waiting)return a.decode()}}(this));this.init()}var k;h(q,b);q.prototype.init=function(){};q.prototype.setCookie=function(a){};q.prototype.readChunk=function(){};q.prototype.decode=function(){var a,b;this.waiting=!1;a=this.bitstream.offset();try{b=this.readChunk()}catch(c){if(!(c instanceof d))return this.emit("error",c),!1}if(b)return this.emit("data",b),!0;this.receivedFinalBuffer?this.emit("end"):(this.bitstream.seek(a),this.waiting=!0);return!1};q.prototype.seek=function(a){a=this.demuxer.seek(a);
|
|
this.stream.seek(a.offset);return a.timestamp};k={};q.register=function(a,b){return k[a]=b};q.find=function(a){return k[a]||null};return q}(g);m.exports=b},{"./core/bitstream":6,"./core/bufferlist":8,"./core/events":9,"./core/stream":10,"./core/underflow":11}],13:[function(b,m,g){var l,a=function(a,b){return function(){return a.apply(b,arguments)}},e={}.hasOwnProperty,d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c;
|
|
a.__super__=b.prototype;return a};l=b("../decoder");(function(b){function h(){this.readChunk=a(this.readChunk,this);return h.__super__.constructor.apply(this,arguments)}d(h,b);l.register("lpcm",h);h.prototype.readChunk=function(){var a,b,k,h,d,u;d=this.stream;b=this.format.littleEndian;a=Math.min(4096,d.remainingBytes());h=a/(this.format.bitsPerChannel/8)|0;if(a<this.format.bitsPerChannel/8)return null;if(this.format.floatingPoint)switch(this.format.bitsPerChannel){case 32:k=new Float32Array(h);for(a=
|
|
u=0;u<h;a=u+=1)k[a]=d.readFloat32(b);break;case 64:k=new Float64Array(h);for(a=u=0;u<h;a=u+=1)k[a]=d.readFloat64(b);break;default:throw Error("Unsupported bit depth.");}else switch(this.format.bitsPerChannel){case 8:k=new Int8Array(h);for(a=b=0;b<h;a=b+=1)k[a]=d.readInt8();break;case 16:k=new Int16Array(h);for(a=u=0;u<h;a=u+=1)k[a]=d.readInt16(b);break;case 24:k=new Int32Array(h);for(a=u=0;u<h;a=u+=1)k[a]=d.readInt24(b);break;case 32:k=new Int32Array(h);for(a=u=0;u<h;a=u+=1)k[a]=d.readInt32(b);break;
|
|
default:throw Error("Unsupported bit depth.");}return k};return h})(l)},{"../decoder":12}],14:[function(b,m,g){var l,a=function(a,b){return function(){return a.apply(b,arguments)}},e={}.hasOwnProperty,d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a};l=b("../decoder");(function(b){function h(){this.readChunk=a(this.readChunk,this);return h.__super__.constructor.apply(this,arguments)}d(h,
|
|
b);l.register("ulaw",h);l.register("alaw",h);h.prototype.init=function(){var a,b,k,h,d,u;this.format.bitsPerChannel=16;this.table=h=new Int16Array(256);if("ulaw"===this.format.formatID)for(a=b=0;256>b;a=++b)d=~a,k=((d&15)<<3)+132,k<<=(d&112)>>>4,h[a]=d&128?132-k:k-132;else for(a=u=0;256>u;a=++u)d=a^85,k=d&15,k=(b=(d&112)>>>4)?k+k+1+32<<b+2:k+k+1<<3,h[a]=d&128?k:-k};h.prototype.readChunk=function(){var a,b,k,h,d,u;h=this.stream;d=this.table;k=Math.min(4096,this.stream.remainingBytes());if(0!==k){b=
|
|
new Int16Array(k);for(a=u=0;u<k;a=u+=1)b[a]=d[h.readUInt8()];return b}};return h})(l)},{"../decoder":12}],15:[function(b,m,g){var l,a,e={}.hasOwnProperty,d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a};g=b("./core/events");l=b("./core/bufferlist");a=b("./core/stream");b=function(b){function h(b,k){var c,d;c=new l;c.append(k);this.stream=new a(c);d=!1;b.on("data",function(a){return function(b){d=
|
|
!0;c.append(b);return a.readChunk(b)}}(this));b.on("error",function(a){return function(b){return a.emit("error",b)}}(this));b.on("end",function(a){return function(){d||a.readChunk(k);return a.emit("end")}}(this));this.seekPoints=[];this.init()}var c;d(h,b);h.probe=function(a){return!1};h.prototype.init=function(){};h.prototype.readChunk=function(a){};h.prototype.addSeekPoint=function(a,b){var c;c=this.searchTimestamp(b);return this.seekPoints.splice(c,0,{offset:a,timestamp:b})};h.prototype.searchTimestamp=
|
|
function(a,b){var c,d,h,e;d=0;c=this.seekPoints.length;if(0<c&&this.seekPoints[c-1].timestamp<a)return c;for(;d<c;)h=d+c>>1,e=this.seekPoints[h].timestamp,e<a?d=h+1:e>=a&&(c=h);c>this.seekPoints.length&&(c=this.seekPoints.length);return c};h.prototype.seek=function(a){if(this.format&&0<this.format.framesPerPacket&&0<this.format.bytesPerPacket)return a={timestamp:a,offset:this.format.bytesPerPacket*a/this.format.framesPerPacket};a=this.searchTimestamp(a);return this.seekPoints[a]};c=[];h.register=
|
|
function(a){return c.push(a)};h.find=function(b){var k,d,h,e;d=a.fromBuffer(b);h=0;for(e=c.length;h<e;h++){b=c[h];k=d.offset;try{if(b.probe(d))return b}catch(q){}d.seek(k)}return null};return h}(g);m.exports=b},{"./core/bufferlist":8,"./core/events":9,"./core/stream":10}],16:[function(b,m,g){var l,a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};l=b("../demuxer");
|
|
(function(a){function b(){return b.__super__.constructor.apply(this,arguments)}e(b,a);l.register(b);b.probe=function(a){var b;return"FORM"===a.peekString(0,4)&&("AIFF"===(b=a.peekString(8,4))||"AIFC"===b)};b.prototype.readChunk=function(){var a;if(!this.readStart&&this.stream.available(12)){if("FORM"!==this.stream.readString(4))return this.emit("error","Invalid AIFF.");this.fileSize=this.stream.readUInt32();this.fileType=this.stream.readString(4);this.readStart=!0;if("AIFF"!==(a=this.fileType)&&"AIFC"!==
|
|
a)return this.emit("error","Invalid AIFF.")}for(;this.stream.available(1);){!this.readHeaders&&this.stream.available(8)&&(this.type=this.stream.readString(4),this.len=this.stream.readUInt32());switch(this.type){case "COMM":if(!this.stream.available(this.len))return;this.format={formatID:"lpcm",channelsPerFrame:this.stream.readUInt16(),sampleCount:this.stream.readUInt32(),bitsPerChannel:this.stream.readUInt16(),sampleRate:this.stream.readFloat80(),framesPerPacket:1,littleEndian:!1,floatingPoint:!1};
|
|
this.format.bytesPerPacket=this.format.bitsPerChannel/8*this.format.channelsPerFrame;if("AIFC"===this.fileType){a=this.stream.readString(4);this.format.littleEndian="sowt"===a&&8<this.format.bitsPerChannel;this.format.floatingPoint="fl32"===a||"fl64"===a;if("twos"===a||"sowt"===a||"fl32"===a||"fl64"===a||"NONE"===a)a="lpcm";this.format.formatID=a;this.len-=4}this.stream.advance(this.len-18);this.emit("format",this.format);this.emit("duration",this.format.sampleCount/this.format.sampleRate*1E3|0);
|
|
break;case "SSND":this.readSSNDHeader&&this.stream.available(4)||(a=this.stream.readUInt32(),this.stream.advance(4),this.stream.advance(a),this.readSSNDHeader=!0);a=this.stream.readSingleBuffer(this.len);this.len-=a.length;this.readHeaders=0<this.len;this.emit("data",a);break;default:if(!this.stream.available(this.len))return;this.stream.advance(this.len)}"SSND"!==this.type&&(this.readHeaders=!1)}};return b})(l)},{"../demuxer":15}],17:[function(b,m,g){var l,a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=
|
|
b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};l=b("../demuxer");(function(a){function b(){return b.__super__.constructor.apply(this,arguments)}var h,c;e(b,a);l.register(b);b.probe=function(a){return".snd"===a.peekString(0,4)};h=[8,8,16,24,32,32,64];h[26]=8;c={1:"ulaw",27:"alaw"};b.prototype.readChunk=function(){var a,b;if(!this.readHeader&&this.stream.available(24)){if(".snd"!==this.stream.readString(4))return this.emit("error",
|
|
"Invalid AU file.");this.stream.readUInt32();b=this.stream.readUInt32();a=this.stream.readUInt32();this.format={formatID:c[a]||"lpcm",littleEndian:!1,floatingPoint:6===a||7===a,bitsPerChannel:h[a-1],sampleRate:this.stream.readUInt32(),channelsPerFrame:this.stream.readUInt32(),framesPerPacket:1};if(null==this.format.bitsPerChannel)return this.emit("error","Unsupported encoding in AU file.");this.format.bytesPerPacket=this.format.bitsPerChannel/8*this.format.channelsPerFrame;4294967295!==b&&(a=this.format.bitsPerChannel/
|
|
8,this.emit("duration",b/a/this.format.channelsPerFrame/this.format.sampleRate*1E3|0));this.emit("format",this.format);this.readHeader=!0}if(this.readHeader)for(;this.stream.available(1);)this.emit("data",this.stream.readSingleBuffer(this.stream.remainingBytes()))};return b})(l)},{"../demuxer":15}],18:[function(b,m,g){var l,a,e={}.hasOwnProperty,d=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;
|
|
return a};l=b("../demuxer");a=b("./m4a");(function(b){function h(){return h.__super__.constructor.apply(this,arguments)}d(h,b);l.register(h);h.probe=function(a){return"caff"===a.peekString(0,4)};h.prototype.readChunk=function(){var b,d,k,h,t,e;if(!this.format&&this.stream.available(64)){if("caff"!==this.stream.readString(4))return this.emit("error","Invalid CAF, does not begin with 'caff'");this.stream.advance(4);if("desc"!==this.stream.readString(4))return this.emit("error","Invalid CAF, 'caff' is not followed by 'desc'");
|
|
if(0!==this.stream.readUInt32()||32!==this.stream.readUInt32())return this.emit("error","Invalid 'desc' size, should be 32");this.format={};this.format.sampleRate=this.stream.readFloat64();this.format.formatID=this.stream.readString(4);b=this.stream.readUInt32();"lpcm"===this.format.formatID&&(this.format.floatingPoint=Boolean(b&1),this.format.littleEndian=Boolean(b&2));this.format.bytesPerPacket=this.stream.readUInt32();this.format.framesPerPacket=this.stream.readUInt32();this.format.channelsPerFrame=
|
|
this.stream.readUInt32();this.format.bitsPerChannel=this.stream.readUInt32();this.emit("format",this.format)}for(;this.stream.available(1);){if(!this.headerCache&&(this.headerCache={type:this.stream.readString(4),oversize:0!==this.stream.readUInt32(),size:this.stream.readUInt32()},this.headerCache.oversize))return this.emit("error","Holy Shit, an oversized file, not supported in JS");switch(this.headerCache.type){case "kuki":this.stream.available(this.headerCache.size)&&("aac "===this.format.formatID?
|
|
(b=this.stream.offset+this.headerCache.size,(d=a.readEsds(this.stream))&&this.emit("cookie",d),this.stream.seek(b)):(b=this.stream.readBuffer(this.headerCache.size),this.emit("cookie",b)),this.headerCache=null);break;case "pakt":if(this.stream.available(this.headerCache.size)){if(0!==this.stream.readUInt32())return this.emit("error","Sizes greater than 32 bits are not supported.");this.numPackets=this.stream.readUInt32();if(0!==this.stream.readUInt32())return this.emit("error","Sizes greater than 32 bits are not supported.");
|
|
this.numFrames=this.stream.readUInt32();this.primingFrames=this.stream.readUInt32();this.remainderFrames=this.stream.readUInt32();this.emit("duration",this.numFrames/this.format.sampleRate*1E3|0);this.sentDuration=!0;h=k=b=0;for(t=this.numPackets;h<t;h+=1)this.addSeekPoint(b,k),b+=this.format.bytesPerPacket||a.readDescrLen(this.stream),k+=this.format.framesPerPacket||a.readDescrLen(this.stream);this.headerCache=null}break;case "info":b=this.stream.readUInt32();h={};for(e=0;0<=b?e<b:e>b;0<=b?++e:--e)k=
|
|
this.stream.readString(null),t=this.stream.readString(null),h[k]=t;this.emit("metadata",h);this.headerCache=null;break;case "data":this.sentFirstDataChunk||(this.stream.advance(4),this.headerCache.size-=4,0===this.format.bytesPerPacket||this.sentDuration||(this.numFrames=this.headerCache.size/this.format.bytesPerPacket,this.emit("duration",this.numFrames/this.format.sampleRate*1E3|0)),this.sentFirstDataChunk=!0);b=this.stream.readSingleBuffer(this.headerCache.size);this.headerCache.size-=b.length;
|
|
this.emit("data",b);0>=this.headerCache.size&&(this.headerCache=null);break;default:this.stream.available(this.headerCache.size)&&(this.stream.advance(this.headerCache.size),this.headerCache=null)}}};return h})(l)},{"../demuxer":15,"./m4a":19}],19:[function(b,m,g){var l,a={}.hasOwnProperty,e=function(b,d){function c(){this.constructor=b}for(var e in d)a.call(d,e)&&(b[e]=d[e]);c.prototype=d.prototype;b.prototype=new c;b.__super__=d.prototype;return b},d=[].indexOf||function(a){for(var b=0,c=this.length;b<
|
|
c;b++)if(b in this&&this[b]===a)return b;return-1};l=b("../demuxer");b=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}var c,x,k,w,t,u,H;e(b,a);l.register(b);x="M4A ;M4P ;M4B ;M4V ;isom;mp42;qt ".split(";");b.probe=function(a){var b;return"ftyp"===a.peekString(4,4)&&(b=a.peekString(8,4),0<=d.call(x,b))};b.prototype.init=function(){this.atoms=[];this.offsets=[];this.track=null;return this.tracks=[]};w={};u={};k=function(a,b){var k,c,d,h,e;k=[];e=a.split(".").slice(0,
|
|
-1);d=0;for(h=e.length;d<h;d++)c=e[d],k.push(c),u[k.join(".")]=!0;null==w[a]&&(w[a]={});return w[a].fn=b};a=function(a,b){null==w[a]&&(w[a]={});return w[a].after=b};b.prototype.readChunk=function(){var a,b;for(this["break"]=!1;this.stream.available(1)&&!this["break"];){if(!this.readHeaders){if(!this.stream.available(8))break;this.len=this.stream.readUInt32()-8;this.type=this.stream.readString(4);if(0===this.len)continue;this.atoms.push(this.type);this.offsets.push(this.stream.offset+this.len);this.readHeaders=
|
|
!0}b=this.atoms.join(".");a=w[b];if(null!=a&&a.fn){if(!this.stream.available(this.len)&&"mdat"!==b)break;a.fn.call(this);b in u&&(this.readHeaders=!1)}else if(b in u)this.readHeaders=!1;else{if(!this.stream.available(this.len))break;this.stream.advance(this.len)}for(;this.stream.offset>=this.offsets[this.offsets.length-1];)a=w[this.atoms.join(".")],null!=a&&a.after&&a.after.call(this),this.atoms.pop(),this.offsets.pop(),this.readHeaders=!1}};k("ftyp",function(){var a;return(a=this.stream.readString(4),
|
|
0>d.call(x,a))?this.emit("error","Not a valid M4A file."):this.stream.advance(this.len-4)});k("moov.trak",function(){this.track={};return this.tracks.push(this.track)});k("moov.trak.tkhd",function(){this.stream.advance(4);this.stream.advance(8);this.track.id=this.stream.readUInt32();return this.stream.advance(this.len-16)});k("moov.trak.mdia.hdlr",function(){this.stream.advance(4);this.stream.advance(4);this.track.type=this.stream.readString(4);this.stream.advance(12);return this.stream.advance(this.len-
|
|
24)});k("moov.trak.mdia.mdhd",function(){this.stream.advance(4);this.stream.advance(8);this.track.timeScale=this.stream.readUInt32();this.track.duration=this.stream.readUInt32();return this.stream.advance(4)});c={ulaw:8,alaw:8,in24:24,in32:32,fl32:32,fl64:64};k("moov.trak.mdia.minf.stbl.stsd",function(){var a,b,k,d;this.stream.advance(4);a=this.stream.readUInt32();if("soun"!==this.track.type)return this.stream.advance(this.len-8);if(1!==a)return this.emit("error","Only expecting one entry in sample description atom!");
|
|
this.stream.advance(4);a=this.track.format={};a.formatID=this.stream.readString(4);this.stream.advance(6);this.stream.advance(2);b=this.stream.readUInt16();this.stream.advance(6);a.channelsPerFrame=this.stream.readUInt16();a.bitsPerChannel=this.stream.readUInt16();this.stream.advance(4);a.sampleRate=this.stream.readUInt16();this.stream.advance(2);1===b?(a.framesPerPacket=this.stream.readUInt32(),this.stream.advance(4),a.bytesPerFrame=this.stream.readUInt32(),this.stream.advance(4)):0!==b&&this.emit("error",
|
|
"Unknown version in stsd atom");null!=c[a.formatID]&&(a.bitsPerChannel=c[a.formatID]);a.floatingPoint="fl32"===(k=a.formatID)||"fl64"===k;a.littleEndian="sowt"===a.formatID&&8<a.bitsPerChannel;if("twos"===(d=a.formatID)||"sowt"===d||"in24"===d||"in32"===d||"fl32"===d||"fl64"===d||"raw "===d||"NONE"===d)return a.formatID="lpcm"});k("moov.trak.mdia.minf.stbl.stsd.alac",function(){this.stream.advance(4);return this.track.cookie=this.stream.readBuffer(this.len-4)});k("moov.trak.mdia.minf.stbl.stsd.esds",
|
|
function(){var a;a=this.stream.offset+this.len;this.track.cookie=b.readEsds(this.stream);return this.stream.seek(a)});k("moov.trak.mdia.minf.stbl.stsd.wave.enda",function(){return this.track.format.littleEndian=!!this.stream.readUInt16()});b.readDescrLen=function(a){var b,k,c;c=0;for(k=4;k--&&(b=a.readUInt8(),c=c<<7|b&127,b&128););return c};b.readEsds=function(a){var k,c;a.advance(4);c=a.readUInt8();b.readDescrLen(a);3===c?(a.advance(2),k=a.readUInt8(),k&128&&a.advance(2),k&64&&a.advance(a.readUInt8()),
|
|
k&32&&a.advance(2)):a.advance(2);c=a.readUInt8();b.readDescrLen(a);return 4===c&&(a.readUInt8(),a.advance(1),a.advance(3),a.advance(4),a.advance(4),c=a.readUInt8(),k=b.readDescrLen(a),5===c)?a.readBuffer(k):null};k("moov.trak.mdia.minf.stbl.stts",function(){var a,b,k;this.stream.advance(4);a=this.stream.readUInt32();this.track.stts=[];for(b=k=0;k<a;b=k+=1)this.track.stts[b]={count:this.stream.readUInt32(),duration:this.stream.readUInt32()};return this.setupSeekPoints()});k("moov.trak.mdia.minf.stbl.stsc",
|
|
function(){var a,b,k;this.stream.advance(4);a=this.stream.readUInt32();this.track.stsc=[];for(b=k=0;k<a;b=k+=1)this.track.stsc[b]={first:this.stream.readUInt32(),count:this.stream.readUInt32(),id:this.stream.readUInt32()};return this.setupSeekPoints()});k("moov.trak.mdia.minf.stbl.stsz",function(){var a,b,k;this.stream.advance(4);this.track.sampleSize=this.stream.readUInt32();a=this.stream.readUInt32();if(0===this.track.sampleSize&&0<a)for(this.track.sampleSizes=[],b=k=0;k<a;b=k+=1)this.track.sampleSizes[b]=
|
|
this.stream.readUInt32();return this.setupSeekPoints()});k("moov.trak.mdia.minf.stbl.stco",function(){var a,b,k;this.stream.advance(4);a=this.stream.readUInt32();this.track.chunkOffsets=[];for(b=k=0;k<a;b=k+=1)this.track.chunkOffsets[b]=this.stream.readUInt32();return this.setupSeekPoints()});k("moov.trak.tref.chap",function(){var a,b,k;a=this.len>>2;this.track.chapterTracks=[];for(b=k=0;k<a;b=k+=1)this.track.chapterTracks[b]=this.stream.readUInt32()});b.prototype.setupSeekPoints=function(){var a,
|
|
b,k,c,d,h,e,t,u,w,q,l,H,x,g;if(null!=this.track.chunkOffsets&&null!=this.track.stsc&&null!=this.track.sampleSize&&null!=this.track.stts){u=b=c=t=e=h=0;this.track.seekPoints=[];H=this.track.chunkOffsets;g=[];a=w=0;for(l=H.length;w<l;a=++w){k=H[a];q=0;for(x=this.track.stsc[h].count;q<x;q+=1)this.track.seekPoints.push({offset:b,position:k,timestamp:u}),d=this.track.sampleSize||this.track.sampleSizes[c++],b+=d,k+=d,u+=this.track.stts[e].duration,e+1<this.track.stts.length&&++t===this.track.stts[e].count&&
|
|
(t=0,e++);h+1<this.track.stsc.length&&a+1===this.track.stsc[h+1].first?g.push(h++):g.push(void 0)}return g}};a("moov",function(){var a,b,k,c;null!=this.mdatOffset&&this.stream.seek(this.mdatOffset-8);c=this.tracks;b=0;for(k=c.length;b<k;b++)if(a=c[b],"soun"===a.type){this.track=a;break}if("soun"!==this.track.type)return this.track=null,this.emit("error","No audio tracks in m4a file.");this.emit("format",this.track.format);this.emit("duration",this.track.duration/this.track.timeScale*1E3|0);this.track.cookie&&
|
|
this.emit("cookie",this.track.cookie);return this.seekPoints=this.track.seekPoints});k("mdat",function(){var a,b,k,c,d,h,e;if(!this.startedData){null==this.mdatOffset&&(this.mdatOffset=this.stream.offset);if(0===this.tracks.length){a=Math.min(this.stream.remainingBytes(),this.len);this.stream.advance(a);this.len-=a;return}this.tailSamples=this.tailOffset=this.sampleIndex=this.stscIndex=this.chunkIndex=0;this.startedData=!0}if(!this.readChapters){this.readChapters=this.parseChapters();if(this["break"]=
|
|
!this.readChapters)return;this.stream.seek(this.mdatOffset)}c=this.track.chunkOffsets[this.chunkIndex]+this.tailOffset;b=0;if(this.stream.available(c-this.stream.offset)){for(this.stream.seek(c);this.chunkIndex<this.track.chunkOffsets.length;){k=this.track.stsc[this.stscIndex].count-this.tailSamples;for(d=e=a=0;e<k;d=e+=1){h=this.track.sampleSize||this.track.sampleSizes[this.sampleIndex];if(!this.stream.available(b+h))break;b+=h;a+=h;this.sampleIndex++}if(d<k){this.tailOffset+=a;this.tailSamples+=
|
|
d;break}else if(this.chunkIndex++,this.tailSamples=this.tailOffset=0,this.stscIndex+1<this.track.stsc.length&&this.chunkIndex+1===this.track.stsc[this.stscIndex+1].first&&this.stscIndex++,c+b!==this.track.chunkOffsets[this.chunkIndex])break}return 0<b?(this.emit("data",this.stream.readBuffer(b)),this["break"]=this.chunkIndex===this.track.chunkOffsets.length):this["break"]=!0}this["break"]=!0});b.prototype.parseChapters=function(){var a,b,k,c,d,h,e;if(!(0<(null!=(b=this.track.chapterTracks)?b.length:
|
|
void 0)))return!0;b=this.track.chapterTracks[0];k=this.tracks;c=0;for(a=k.length;c<a&&(d=k[c],d.id!==b);c++);d.id!==b&&this.emit("error","Chapter track does not exist.");null==this.chapters&&(this.chapters=[]);for(;this.chapters.length<d.seekPoints.length;){b=d.seekPoints[this.chapters.length];if(!this.stream.available(b.position-this.stream.offset+32))return!1;this.stream.seek(b.position);k=this.stream.readUInt16();c=null;if(!this.stream.available(k))return!1;2<k&&(a=this.stream.peekUInt16(),65279===
|
|
a||65534===a)&&(c=this.stream.readString(k,"utf16-bom"));null==c&&(c=this.stream.readString(k,"utf8"));a=null!=(h=null!=(e=d.seekPoints[this.chapters.length+1])?e.timestamp:void 0)?h:d.duration;this.chapters.push({title:c,timestamp:b.timestamp/d.timeScale*1E3|0,duration:(a-b.timestamp)/d.timeScale*1E3|0})}this.emit("chapters",this.chapters);return!0};k("moov.udta.meta",function(){this.metadata={};return this.stream.advance(4)});a("moov.udta.meta",function(){return this.emit("metadata",this.metadata)});
|
|
a=function(a,b,c){return k("moov.udta.meta.ilst."+a+".data",function(){this.stream.advance(8);this.len-=8;return c.call(this,b)})};t=function(a){return this.metadata[a]=this.stream.readString(this.len,"utf8")};a("\u00a9alb","album",t);a("\u00a9arg","arranger",t);a("\u00a9art","artist",t);a("\u00a9ART","artist",t);a("aART","albumArtist",t);a("catg","category",t);a("\u00a9com","composer",t);a("\u00a9cpy","copyright",t);a("cprt","copyright",t);a("\u00a9cmt","comments",t);a("\u00a9day","releaseDate",
|
|
t);a("desc","description",t);a("\u00a9gen","genre",t);a("\u00a9grp","grouping",t);a("\u00a9isr","ISRC",t);a("keyw","keywords",t);a("\u00a9lab","recordLabel",t);a("ldes","longDescription",t);a("\u00a9lyr","lyrics",t);a("\u00a9nam","title",t);a("\u00a9phg","recordingCopyright",t);a("\u00a9prd","producer",t);a("\u00a9prf","performers",t);a("purd","purchaseDate",t);a("purl","podcastURL",t);a("\u00a9swf","songwriter",t);a("\u00a9too","encoder",t);a("\u00a9wrt","composer",t);a("covr","coverArt",function(a){return this.metadata[a]=
|
|
this.stream.readBuffer(this.len)});H="Blues;Classic Rock;Country;Dance;Disco;Funk;Grunge;Hip-Hop;Jazz;Metal;New Age;Oldies;Other;Pop;R&B;Rap;Reggae;Rock;Techno;Industrial;Alternative;Ska;Death Metal;Pranks;Soundtrack;Euro-Techno;Ambient;Trip-Hop;Vocal;Jazz+Funk;Fusion;Trance;Classical;Instrumental;Acid;House;Game;Sound Clip;Gospel;Noise;AlternRock;Bass;Soul;Punk;Space;Meditative;Instrumental Pop;Instrumental Rock;Ethnic;Gothic;Darkwave;Techno-Industrial;Electronic;Pop-Folk;Eurodance;Dream;Southern Rock;Comedy;Cult;Gangsta;Top 40;Christian Rap;Pop/Funk;Jungle;Native American;Cabaret;New Wave;Psychadelic;Rave;Showtunes;Trailer;Lo-Fi;Tribal;Acid Punk;Acid Jazz;Polka;Retro;Musical;Rock & Roll;Hard Rock;Folk;Folk/Rock;National Folk;Swing;Fast Fusion;Bebob;Latin;Revival;Celtic;Bluegrass;Avantgarde;Gothic Rock;Progressive Rock;Psychedelic Rock;Symphonic Rock;Slow Rock;Big Band;Chorus;Easy Listening;Acoustic;Humour;Speech;Chanson;Opera;Chamber Music;Sonata;Symphony;Booty Bass;Primus;Porn Groove;Satire;Slow Jam;Club;Tango;Samba;Folklore;Ballad;Power Ballad;Rhythmic Soul;Freestyle;Duet;Punk Rock;Drum Solo;A Capella;Euro-House;Dance Hall".split(";");
|
|
a("gnre","genre",function(a){return this.metadata[a]=H[this.stream.readUInt16()-1]});a("tmpo","tempo",function(a){return this.metadata[a]=this.stream.readUInt16()});a("rtng","rating",function(a){var b;b=this.stream.readUInt8();return this.metadata[a]=2===b?"Clean":0!==b?"Explicit":"None"});t=function(a){this.stream.advance(2);this.metadata[a]=this.stream.readUInt16()+" of "+this.stream.readUInt16();return this.stream.advance(this.len-6)};a("disk","diskNumber",t);a("trkn","trackNumber",t);t=function(a){return this.metadata[a]=
|
|
1===this.stream.readUInt8()};a("cpil","compilation",t);a("pcst","podcast",t);a("pgap","gapless",t);return b}(l);m.exports=b},{"../demuxer":15}],20:[function(b,m,g){var l,a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};l=b("../demuxer");(function(a){function b(){return b.__super__.constructor.apply(this,arguments)}var h;e(b,a);l.register(b);b.probe=function(a){return"RIFF"===
|
|
a.peekString(0,4)&&"WAVE"===a.peekString(8,4)};h={1:"lpcm",3:"lpcm",6:"alaw",7:"ulaw"};b.prototype.readChunk=function(){var a;if(!this.readStart&&this.stream.available(12)){if("RIFF"!==this.stream.readString(4))return this.emit("error","Invalid WAV file.");this.fileSize=this.stream.readUInt32(!0);this.readStart=!0;if("WAVE"!==this.stream.readString(4))return this.emit("error","Invalid WAV file.")}for(;this.stream.available(1);){!this.readHeaders&&this.stream.available(8)&&(this.type=this.stream.readString(4),
|
|
this.len=this.stream.readUInt32(!0));switch(this.type){case "fmt ":a=this.stream.readUInt16(!0);if(!(a in h))return this.emit("error","Unsupported format in WAV file.");this.format={formatID:h[a],floatingPoint:3===a,littleEndian:"lpcm"===h[a],channelsPerFrame:this.stream.readUInt16(!0),sampleRate:this.stream.readUInt32(!0),framesPerPacket:1};this.stream.advance(4);this.stream.advance(2);this.format.bitsPerChannel=this.stream.readUInt16(!0);this.format.bytesPerPacket=this.format.bitsPerChannel/8*this.format.channelsPerFrame;
|
|
this.emit("format",this.format);this.stream.advance(this.len-16);break;case "data":this.sentDuration||(a=this.format.bitsPerChannel/8,this.emit("duration",this.len/a/this.format.channelsPerFrame/this.format.sampleRate*1E3|0),this.sentDuration=!0);a=this.stream.readSingleBuffer(this.len);this.len-=a.length;this.readHeaders=0<this.len;this.emit("data",a);break;default:if(!this.stream.available(this.len))return;this.stream.advance(this.len)}"data"!==this.type&&(this.readHeaders=!1)}};return b})(l)},
|
|
{"../demuxer":15}],21:[function(b,m,g){var l=function(a,b){return function(){return a.apply(b,arguments)}},a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};b=function(a){function b(a,d){this.sampleRate=a;this.channels=d;this.updateTime=l(this.updateTime,this);this.playing=!1;this._lastTime=this.currentTime=0}var h;e(b,a);b.prototype.start=function(){if(!this.playing){this.playing=
|
|
!0;null==this.device&&(this.device=b.create(this.sampleRate,this.channels));if(!this.device)throw Error("No supported audio device found.");this._lastTime=this.device.getDeviceTime();this._timer=setInterval(this.updateTime,200);return this.device.on("refill",this.refill=function(a){return function(b){return a.emit("refill",b)}}(this))}};b.prototype.stop=function(){if(this.playing)return this.playing=!1,this.device.off("refill",this.refill),clearInterval(this._timer)};b.prototype.destroy=function(){this.stop();
|
|
return this.device.destroy()};b.prototype.seek=function(a){this.currentTime=a;this.playing&&(this._lastTime=this.device.getDeviceTime());return this.emit("timeUpdate",this.currentTime)};b.prototype.updateTime=function(){var a;a=this.device.getDeviceTime();this.currentTime+=(a-this._lastTime)/this.device.sampleRate*1E3|0;this._lastTime=a;return this.emit("timeUpdate",this.currentTime)};h=[];b.register=function(a){return h.push(a)};b.create=function(a,b){var k,d,e;d=0;for(e=h.length;d<e;d++)if(k=h[d],
|
|
k.supported)return new k(a,b);return null};return b}(b("./core/events"));m.exports=b},{"./core/events":9}],22:[function(b,m,g){var l,a,e=function(a,b){return function(){return a.apply(b,arguments)}},d={}.hasOwnProperty,q=function(a,b){function e(){this.constructor=a}for(var k in b)d.call(b,k)&&(a[k]=b[k]);e.prototype=b.prototype;a.prototype=new e;a.__super__=b.prototype;return a};m=b("../core/events");a=b("../device");l=b("../core/buffer");(function(b){function d(a,b){this.sampleRate=a;this.channels=
|
|
b;this.refill=e(this.refill,this);this.audio=new Audio;this.audio.mozSetup(this.channels,this.sampleRate);this.writePosition=0;this.prebufferSize=this.sampleRate/2;this.tail=null;this.timer=g(this.refill,100)}var g,k;q(d,b);a.register(d);d.supported="undefined"!==typeof Audio&&null!==Audio&&"mozWriteAudio"in new Audio;d.prototype.refill=function(){var a,b;this.tail&&(b=this.audio.mozWriteAudio(this.tail),this.writePosition+=b,this.tail=this.writePosition<this.tail.length?this.tail.subarray(b):null);
|
|
a=this.audio.mozCurrentSampleOffset()+this.prebufferSize-this.writePosition;0<a&&(a=new Float32Array(a),this.emit("refill",a),b=this.audio.mozWriteAudio(a),b<a.length&&(this.tail=a.subarray(b)),this.writePosition+=b)};d.prototype.destroy=function(){return k(this.timer)};d.prototype.getDeviceTime=function(){return this.audio.mozCurrentSampleOffset()/this.channels};g=function(a,b){var k,d;k=l.makeBlobURL("setInterval(function() { postMessage('ping'); }, "+b+");");if(null==k)return setInterval(a,b);
|
|
d=new Worker(k);d.onmessage=a;d.url=k;return d};k=function(a){return a.terminate?(a.terminate(),URL.revokeObjectURL(a.url)):clearInterval(a)};return d})(m)},{"../core/buffer":7,"../core/events":9,"../device":21}],23:[function(b,m,g){function l(a,b,d,q,h){this.fromSampleRate=a;this.toSampleRate=b;this.channels=d|0;this.outputBufferSize=q;this.noReturn=!!h;this.initialize()}l.prototype.initialize=function(){if(0<this.fromSampleRate&&0<this.toSampleRate&&0<this.channels)this.fromSampleRate==this.toSampleRate?
|
|
(this.resampler=this.bypassResampler,this.ratioWeight=1):(this.fromSampleRate<this.toSampleRate?(this.compileLinearInterpolationFunction(),this.lastWeight=1):(this.compileMultiTapFunction(),this.tailExists=!1,this.lastWeight=0),this.ratioWeight=this.fromSampleRate/this.toSampleRate,this.initializeBuffers());else throw Error("Invalid settings specified for the resampler.");};l.prototype.compileLinearInterpolationFunction=function(){for(var a="var bufferLength = buffer.length;\tvar outLength = this.outputBufferSize;\tif ((bufferLength % "+
|
|
this.channels+") == 0) {\t\tif (bufferLength > 0) {\t\t\tvar ratioWeight = this.ratioWeight;\t\t\tvar weight = this.lastWeight;\t\t\tvar firstWeight = 0;\t\t\tvar secondWeight = 0;\t\t\tvar sourceOffset = 0;\t\t\tvar outputOffset = 0;\t\t\tvar outputBuffer = this.outputBuffer;\t\t\tfor (; weight < 1; weight += ratioWeight) {\t\t\t\tsecondWeight = weight % 1;\t\t\t\tfirstWeight = 1 - secondWeight;",b=0;b<this.channels;++b)a+="outputBuffer[outputOffset++] = (this.lastOutput["+b+"] * firstWeight) + (buffer["+
|
|
b+"] * secondWeight);";a+="}\t\t\tweight -= 1;\t\t\tfor (bufferLength -= "+this.channels+", sourceOffset = Math.floor(weight) * "+this.channels+"; outputOffset < outLength && sourceOffset < bufferLength;) {\t\t\t\tsecondWeight = weight % 1;\t\t\t\tfirstWeight = 1 - secondWeight;";for(b=0;b<this.channels;++b)a+="outputBuffer[outputOffset++] = (buffer[sourceOffset"+(0<b?" + "+b:"")+"] * firstWeight) + (buffer[sourceOffset + "+(this.channels+b)+"] * secondWeight);";a+="weight += ratioWeight;\t\t\t\tsourceOffset = Math.floor(weight) * "+
|
|
this.channels+";\t\t\t}";for(b=0;b<this.channels;++b)a+="this.lastOutput["+b+"] = buffer[sourceOffset++];";this.resampler=Function("buffer",a+'this.lastWeight = weight % 1;\t\t\treturn this.bufferSlice(outputOffset);\t\t}\t\telse {\t\t\treturn (this.noReturn) ? 0 : [];\t\t}\t}\telse {\t\tthrow(new Error("Buffer was of incorrect sample length."));\t}')};l.prototype.compileMultiTapFunction=function(){for(var a="var bufferLength = buffer.length;\tvar outLength = this.outputBufferSize;\tif ((bufferLength % "+
|
|
this.channels+") == 0) {\t\tif (bufferLength > 0) {\t\t\tvar ratioWeight = this.ratioWeight;\t\t\tvar weight = 0;",b=0;b<this.channels;++b)a+="var output"+b+" = 0;";a+="var actualPosition = 0;\t\t\tvar amountToNext = 0;\t\t\tvar alreadyProcessedTail = !this.tailExists;\t\t\tthis.tailExists = false;\t\t\tvar outputBuffer = this.outputBuffer;\t\t\tvar outputOffset = 0;\t\t\tvar currentPosition = 0;\t\t\tdo {\t\t\t\tif (alreadyProcessedTail) {\t\t\t\t\tweight = ratioWeight;";for(b=0;b<this.channels;++b)a+=
|
|
"output"+b+" = 0;";a+="}\t\t\t\telse {\t\t\t\t\tweight = this.lastWeight;";for(b=0;b<this.channels;++b)a+="output"+b+" = this.lastOutput["+b+"];";a+="alreadyProcessedTail = true;\t\t\t\t}\t\t\t\twhile (weight > 0 && actualPosition < bufferLength) {\t\t\t\t\tamountToNext = 1 + actualPosition - currentPosition;\t\t\t\t\tif (weight >= amountToNext) {";for(b=0;b<this.channels;++b)a+="output"+b+" += buffer[actualPosition++] * amountToNext;";a+="currentPosition = actualPosition;\t\t\t\t\t\tweight -= amountToNext;\t\t\t\t\t}\t\t\t\t\telse {";
|
|
for(b=0;b<this.channels;++b)a+="output"+b+" += buffer[actualPosition"+(0<b?" + "+b:"")+"] * weight;";a+="currentPosition += weight;\t\t\t\t\t\tweight = 0;\t\t\t\t\t\tbreak;\t\t\t\t\t}\t\t\t\t}\t\t\t\tif (weight == 0) {";for(b=0;b<this.channels;++b)a+="outputBuffer[outputOffset++] = output"+b+" / ratioWeight;";a+="}\t\t\t\telse {\t\t\t\t\tthis.lastWeight = weight;";for(b=0;b<this.channels;++b)a+="this.lastOutput["+b+"] = output"+b+";";this.resampler=Function("buffer",a+'this.tailExists = true;\t\t\t\t\tbreak;\t\t\t\t}\t\t\t} while (actualPosition < bufferLength && outputOffset < outLength);\t\t\treturn this.bufferSlice(outputOffset);\t\t}\t\telse {\t\t\treturn (this.noReturn) ? 0 : [];\t\t}\t}\telse {\t\tthrow(new Error("Buffer was of incorrect sample length."));\t}')};
|
|
l.prototype.bypassResampler=function(a){return this.noReturn?(this.outputBuffer=a,a.length):a};l.prototype.bufferSlice=function(a){if(this.noReturn)return a;try{return this.outputBuffer.subarray(0,a)}catch(b){try{return this.outputBuffer.length=a,this.outputBuffer}catch(d){return this.outputBuffer.slice(0,a)}}};l.prototype.initializeBuffers=function(){try{this.outputBuffer=new Float32Array(this.outputBufferSize),this.lastOutput=new Float32Array(this.channels)}catch(a){this.outputBuffer=[],this.lastOutput=
|
|
[]}};m.exports=l},{}],24:[function(b,m,g){(function(l){var a,e,d,q=function(a,b){return function(){return a.apply(b,arguments)}},h={}.hasOwnProperty,c=function(a,b){function d(){this.constructor=a}for(var c in b)h.call(b,c)&&(a[c]=b[c]);d.prototype=b.prototype;a.prototype=new d;a.__super__=b.prototype;return a};e=b("../core/events");a=b("../device");d=b("./resampler");(function(b){function k(a,b){this.sampleRate=a;this.channels=b;this.refill=q(this.refill,this);this.context=null!=u?u:u=new h;this.deviceSampleRate=
|
|
this.context.sampleRate;this.bufferSize=Math.ceil(4096/(this.deviceSampleRate/this.sampleRate)*this.channels);this.bufferSize+=this.bufferSize%this.channels;this.deviceSampleRate!==this.sampleRate&&(this.resampler=new d(this.sampleRate,this.deviceSampleRate,this.channels,4096*this.channels));this.node=this.context[e](4096,this.channels,this.channels);this.node.onaudioprocess=this.refill;this.node.connect(this.context.destination)}var h,e,u;c(k,b);a.register(k);h=l.AudioContext||l.webkitAudioContext;
|
|
k.supported=h&&("function"===typeof h.prototype[e="createScriptProcessor"]||"function"===typeof h.prototype[e="createJavaScriptNode"]);u=null;k.prototype.refill=function(a){var b,k,d,c,h,e,t;c=a.outputBuffer;a=c.numberOfChannels;b=Array(a);for(d=k=0;k<a;d=k+=1)b[d]=c.getChannelData(d);k=new Float32Array(this.bufferSize);this.emit("refill",k);this.resampler&&(k=this.resampler.resampler(k));d=h=0;for(t=c.length;h<t;d=h+=1)for(c=e=0;e<a;c=e+=1)b[c][d]=k[d*a+c]};k.prototype.destroy=function(){return this.node.disconnect(0)};
|
|
k.prototype.getDeviceTime=function(){return this.context.currentTime*this.sampleRate};return k})(e)}).call(this,"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../core/events":9,"../device":21,"./resampler":23}],25:[function(b,m,g){b=function(){function b(a,e){a&&e&&Object.defineProperty(this,"value",{get:function(){return a[e]}})}b.prototype.process=function(a){};return b}();m.exports=b},{}],26:[function(b,m,g){var l={}.hasOwnProperty,a=function(a,b){function q(){this.constructor=
|
|
a}for(var h in b)l.call(b,h)&&(a[h]=b[h]);q.prototype=b.prototype;a.prototype=new q;a.__super__=b.prototype;return a};b=function(b){function d(){return d.__super__.constructor.apply(this,arguments)}a(d,b);d.prototype.process=function(a){var b,d,e,k;if(0!==this.value)for(d=Math.max(-50,Math.min(50,this.value)),b=e=0,k=a.length;e<k;b=e+=2)a[b]*=Math.min(1,(50-d)/50),a[b+1]*=Math.min(1,(50+d)/50)};return d}(b("../filter"));m.exports=b},{"../filter":25}],27:[function(b,m,g){var l={}.hasOwnProperty,a=
|
|
function(a,b){function q(){this.constructor=a}for(var h in b)l.call(b,h)&&(a[h]=b[h]);q.prototype=b.prototype;a.prototype=new q;a.__super__=b.prototype;return a};b=function(b){function d(){return d.__super__.constructor.apply(this,arguments)}a(d,b);d.prototype.process=function(a){var b,d,e,k;if(!(100<=this.value))for(d=Math.max(0,Math.min(100,this.value))/100,b=e=0,k=a.length;e<k;b=e+=1)a[b]*=d};return d}(b("../filter"));m.exports=b},{"../filter":25}],28:[function(b,m,g){var l,a,e,d,q,h=function(a,
|
|
b){return function(){return a.apply(b,arguments)}},c={}.hasOwnProperty,x=function(a,b){function d(){this.constructor=a}for(var h in b)c.call(b,h)&&(a[h]=b[h]);d.prototype=b.prototype;a.prototype=new d;a.__super__=b.prototype;return a};g=b("./core/events");l=b("./asset");q=b("./filters/volume");e=b("./filters/balance");d=b("./queue");a=b("./device");b=function(b){function c(a){this.asset=a;this.startPlaying=h(this.startPlaying,this);this.playing=!1;this.duration=this.currentTime=this.buffered=0;this.volume=
|
|
100;this.pan=0;this.metadata={};this.filters=[new q(this,"volume"),new e(this,"pan")];this.asset.on("buffer",function(a){return function(b){a.buffered=b;return a.emit("buffer",a.buffered)}}(this));this.asset.on("decodeStart",function(a){return function(){a.queue=new d(a.asset);return a.queue.once("ready",a.startPlaying)}}(this));this.asset.on("format",function(a){return function(b){a.format=b;return a.emit("format",a.format)}}(this));this.asset.on("metadata",function(a){return function(b){a.metadata=
|
|
b;return a.emit("metadata",a.metadata)}}(this));this.asset.on("duration",function(a){return function(b){a.duration=b;return a.emit("duration",a.duration)}}(this));this.asset.on("error",function(a){return function(b){return a.emit("error",b)}}(this))}x(c,b);c.fromURL=function(a){return new c(l.fromURL(a))};c.fromFile=function(a){return new c(l.fromFile(a))};c.fromBuffer=function(a){return new c(l.fromBuffer(a))};c.prototype.preload=function(){if(this.asset)return this.startedPreloading=!0,this.asset.start(!1)};
|
|
c.prototype.play=function(){var a;if(!this.playing)return this.startedPreloading||this.preload(),this.playing=!0,null!=(a=this.device)?a.start():void 0};c.prototype.pause=function(){var a;if(this.playing)return this.playing=!1,null!=(a=this.device)?a.stop():void 0};c.prototype.togglePlayback=function(){return this.playing?this.pause():this.play()};c.prototype.stop=function(){var a;this.pause();this.asset.stop();return null!=(a=this.device)?a.destroy():void 0};c.prototype.seek=function(a){var b;null!=
|
|
(b=this.device)&&b.stop();this.queue.once("ready",function(a){return function(){var b,k;null!=(b=a.device)&&b.seek(a.currentTime);if(a.playing)return null!=(k=a.device)?k.start():void 0}}(this));a=a/1E3*this.format.sampleRate;a=this.asset.decoder.seek(a);this.currentTime=a/this.format.sampleRate*1E3|0;this.queue.reset();return this.currentTime};c.prototype.startPlaying=function(){var b,k;b=this.queue.read();k=0;this.device=new a(this.format.sampleRate,this.format.channelsPerFrame);this.device.on("timeUpdate",
|
|
function(a){return function(b){a.currentTime=b;return a.emit("progress",a.currentTime)}}(this));this.refill=function(a){return function(d){var c,h,e,w;if(a.playing){b||(b=a.queue.read(),k=0);for(c=0;b&&c<d.length;){h=Math.min(b.length-k,d.length-c);for(e=0;e<h;e+=1)d[c++]=b[k++];k===b.length&&(b=a.queue.read(),k=0)}w=a.filters;h=0;for(e=w.length;h<e;h++)c=w[h],c.process(d);b||(a.queue.ended?(a.currentTime=a.duration,a.emit("progress",a.currentTime),a.emit("end"),a.stop()):a.device.stop())}}}(this);
|
|
this.device.on("refill",this.refill);this.playing&&this.device.start();return this.emit("ready")};return c}(g);m.exports=b},{"./asset":2,"./core/events":9,"./device":21,"./filters/balance":26,"./filters/volume":27,"./queue":29}],29:[function(b,m,g){var l=function(a,b){return function(){return a.apply(b,arguments)}},a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};
|
|
b=function(a){function b(a){this.asset=a;this.write=l(this.write,this);this.readyMark=64;this.finished=!1;this.buffering=!0;this.ended=!1;this.buffers=[];this.asset.on("data",this.write);this.asset.on("end",function(a){return function(){return a.ended=!0}}(this));this.asset.decodePacket()}e(b,a);b.prototype.write=function(a){a&&this.buffers.push(a);if(this.buffering)return this.buffers.length>=this.readyMark||this.ended?(this.buffering=!1,this.emit("ready")):this.asset.decodePacket()};b.prototype.read=
|
|
function(){if(0===this.buffers.length)return null;this.asset.decodePacket();return this.buffers.shift()};b.prototype.reset=function(){this.buffers.length=0;this.buffering=!0;return this.asset.decodePacket()};return b}(b("./core/events"));m.exports=b},{"./core/events":9}],30:[function(b,m,g){var l,a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};g=b("../../core/events");
|
|
l=b("../../core/buffer");b=function(a){function b(a){this.file=a;if("undefined"===typeof FileReader||null===FileReader)return this.emit("error","This browser does not have FileReader support.");this.offset=0;this.length=this.file.size;this.chunkSize=1048576;this.file[this.slice="slice"]||this.file[this.slice="webkitSlice"]||this.file[this.slice="mozSlice"]}e(b,a);b.prototype.start=function(){if(this.reader&&!this.active)return this.loop();this.reader=new FileReader;this.active=!0;this.reader.onload=
|
|
function(a){return function(b){b=new l(new Uint8Array(b.target.result));a.offset+=b.length;a.emit("data",b);a.active=!1;if(a.offset<a.length)return a.loop()}}(this);this.reader.onloadend=function(a){return function(){if(a.offset===a.length)return a.emit("end"),a.reader=null}}(this);this.reader.onerror=function(a){return function(b){return a.emit("error",b)}}(this);this.reader.onprogress=function(a){return function(b){return a.emit("progress",(a.offset+b.loaded)/a.length*100)}}(this);return this.loop()};
|
|
b.prototype.loop=function(){var a;this.active=!0;a=this.file[this.slice](this.offset,Math.min(this.offset+this.chunkSize,this.length));return this.reader.readAsArrayBuffer(a)};b.prototype.pause=function(){var a;this.active=!1;try{return null!=(a=this.reader)?a.abort():void 0}catch(b){}};b.prototype.reset=function(){this.pause();return this.offset=0};return b}(g);m.exports=b},{"../../core/buffer":7,"../../core/events":9}],31:[function(b,m,g){var l,a={}.hasOwnProperty,e=function(b,e){function h(){this.constructor=
|
|
b}for(var c in e)a.call(e,c)&&(b[c]=e[c]);h.prototype=e.prototype;b.prototype=new h;b.__super__=e.prototype;return b};g=b("../../core/events");l=b("../../core/buffer");b=function(a){function b(a){this.url=a;this.chunkSize=1048576;this.inflight=!1;this.reset()}e(b,a);b.prototype.start=function(){if(this.length&&!this.inflight)return this.loop();this.inflight=!0;this.xhr=new XMLHttpRequest;this.xhr.onload=function(a){return function(b){a.length=parseInt(a.xhr.getResponseHeader("Content-Length"));a.inflight=
|
|
!1;return a.loop()}}(this);this.xhr.onerror=function(a){return function(b){a.pause();return a.emit("error",b)}}(this);this.xhr.onabort=function(a){return function(b){return a.inflight=!1}}(this);this.xhr.open("HEAD",this.url,!0);return this.xhr.send(null)};b.prototype.loop=function(){if(this.inflight||!this.length)return this.emit("error","Something is wrong in HTTPSource.loop");this.inflight=!0;this.xhr=new XMLHttpRequest;this.xhr.onload=function(a){return function(b){var d,k,e,t;if(a.xhr.response)b=
|
|
new Uint8Array(a.xhr.response);else for(k=a.xhr.responseText,b=new Uint8Array(k.length),d=e=0,t=k.length;0<=t?e<t:e>t;d=0<=t?++e:--e)b[d]=k.charCodeAt(d)&255;b=new l(b);a.offset+=b.length;a.emit("data",b);a.offset>=a.length&&a.emit("end");a.inflight=!1;if(!(a.offset>=a.length))return a.loop()}}(this);this.xhr.onprogress=function(a){return function(b){return a.emit("progress",(a.offset+b.loaded)/a.length*100)}}(this);this.xhr.onerror=function(a){return function(b){a.emit("error",b);return a.pause()}}(this);
|
|
this.xhr.onabort=function(a){return function(b){return a.inflight=!1}}(this);this.xhr.open("GET",this.url,!0);this.xhr.responseType="arraybuffer";this.xhr.setRequestHeader("Range","bytes="+this.offset+"-"+Math.min(this.offset+this.chunkSize,this.length));this.xhr.overrideMimeType("text/plain; charset=x-user-defined");return this.xhr.send(null)};b.prototype.pause=function(){var a;this.inflight=!1;return null!=(a=this.xhr)?a.abort():void 0};b.prototype.reset=function(){this.pause();return this.offset=
|
|
0};return b}(g);m.exports=b},{"../../core/buffer":7,"../../core/events":9}],32:[function(b,m,g){(function(l){var a,e,d,g=function(a,b){return function(){return a.apply(b,arguments)}},h={}.hasOwnProperty,c=function(a,b){function d(){this.constructor=a}for(var c in b)h.call(b,c)&&(a[c]=b[c]);d.prototype=b.prototype;a.prototype=new d;a.__super__=b.prototype;return a};d=b("../core/events");e=b("../core/bufferlist");a=b("../core/buffer");d=function(b){function k(b){this.loop=g(this.loop,this);b instanceof
|
|
e?this.list=b:(this.list=new e,this.list.append(new a(b)));this.paused=!0}var d,h;c(k,b);h=l.setImmediate||function(a){return l.setTimeout(a,0)};d=l.clearImmediate||function(a){return l.clearTimeout(a)};k.prototype.start=function(){this.paused=!1;return this._timer=h(this.loop)};k.prototype.loop=function(){this.emit("progress",(this.list.numBuffers-this.list.availableBuffers+1)/this.list.numBuffers*100|0);this.emit("data",this.list.first);return this.list.advance()?h(this.loop):this.emit("end")};
|
|
k.prototype.pause=function(){d(this._timer);return this.paused=!0};k.prototype.reset=function(){this.pause();return this.list.rewind()};return k}(d);m.exports=d}).call(this,"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"../core/buffer":7,"../core/bufferlist":8,"../core/events":9}]},{},[1])(1)});(function e$$0(b,m,g){function l(d,e){if(!m[d]){if(!b[d]){var h="function"==typeof require&&require;if(!e&&h)return h(d,!0);if(a)return a(d,!0);throw Error("Cannot find module '"+d+"'");}h=m[d]={exports:{}};b[d][0].call(h.exports,function(a){var e=b[d][1][a];return l(e?e:a)},h,h.exports,e$$0,b,m,g)}return m[d].exports}for(var a="function"==typeof require&&require,e=0;e<g.length;e++)l(g[e]);return l})({1:[function(r,b,m){m.MP3Demuxer=r("./src/demuxer");m.MP3Decoder=r("./src/decoder")},{"./src/decoder":2,
|
|
"./src/demuxer":3}],2:[function(r,b,m){var g=r("./header"),l=r("./stream"),a=r("./frame"),e=r("./synth");r("./layer1");r("./layer2");r("./layer3");r=AV.Decoder.extend(function(){AV.Decoder.register("mp3",this);this.prototype.init=function(){this.mp3_stream=new l(this.bitstream);this.frame=new a;this.synth=new e;this.seeking=!1};this.prototype.readChunk=function(){var a=this.mp3_stream,b=this.frame,e=this.synth;if(this.seeking){for(;;)try{b.decode(a);break}catch(t){if(t instanceof AV.UnderflowError)throw t;
|
|
}this.seeking=!1}else b.decode(a);e.frame(b);for(var a=e.pcm.samples,b=e.pcm.channels,e=e.pcm.length,c=new Float32Array(e*b),l=0,k=0;k<e;k++)for(var w=0;w<b;w++)c[l++]=a[w][k];return c};this.prototype.seek=function(a){var b;0<this.demuxer.seekPoints.length?(a=this._super(a),b=this.stream.offset):b=a*this.format.bitrate/8/this.format.sampleRate;this.mp3_stream.reset(b);for(var e=0;4096>e;e++){for(var c=b+e,l=0;3>l;l++){this.mp3_stream.reset(c);try{var k=g.decode(this.mp3_stream)}catch(t){break}var w=
|
|
k.framesize();if(null==w)break;c+=w}if(3===l)break}3!==l&&(e=0);this.mp3_stream.reset(b+e);0===this.demuxer.seekPoints.length&&(a=this.stream.offset/(this.format.bitrate/8)*this.format.sampleRate);this.seeking=!0;return a}});b.exports=r},{"./frame":4,"./header":5,"./layer1":9,"./layer2":10,"./layer3":11,"./stream":12,"./synth":13}],3:[function(r,b,m){var g=r("./id3").ID3v23Stream,l=r("./id3").ID3v22Stream,a=r("./header"),e=r("./stream"),d=AV.Demuxer.extend(function(){AV.Demuxer.register(this);this.probe=
|
|
function(b){var c=b.offset,l=d.getID3v2Header(b);l&&b.advance(10+l.length);var l=new e(new AV.Bitstream(b)),k=null;try{k=a.decode(l)}catch(w){}b.seek(c);return!!k};this.getID3v2Header=function(a){if("ID3"==a.peekString(0,3)){a=AV.Stream.fromBuffer(a.peekBuffer(0,10));a.advance(3);var b=a.readUInt8(),d=a.readUInt8(),k=a.readUInt8();a=a.readBuffer(4).data;return{version:"2."+b+"."+d,major:b,minor:d,flags:k,length:a[0]<<21|a[1]<<14|a[2]<<7|a[3]}}return null};var b=[[32,17],[17,9]];this.prototype.parseDuration=
|
|
function(d){var c=this.stream,e,k=c.offset;if(!d||3!==d.layer)return!1;c.advance(b[d.flags&a.FLAGS.LSF_EXT?1:0][1===d.nchannels()?1:0]);var w=c.readString(4);if("Xing"===w||"Info"===w){var t=c.readUInt32();t&1&&(e=c.readUInt32());if(t&2)var u=c.readUInt32();if(t&4&&e&&u)for(k=0;100>k;k++){var w=c.readUInt8()/256*u|0,l=k/100*e*d.nbsamples()*32|0;this.addSeekPoint(w,l)}t&8&&c.advance(4)}else if(c.seek(k+4+32),w=c.readString(4),"VBRI"==w&&1===c.readUInt16())for(c.advance(4),c.advance(4),e=c.readUInt32(),
|
|
u=c.readUInt16(),c.readUInt16(),k=c.readUInt16(),t=c.readUInt16(),l="readUInt"+8*k,k=w=0;k<u;k++)this.addSeekPoint(w,t*k),w+=c[l]();if(!e)return!1;this.emit("duration",e*d.nbsamples()*32/d.samplerate*1E3|0);return!0};this.prototype.readChunk=function(){var b=this.stream;if(!this.sentInfo){var c=d.getID3v2Header(b);c&&(b.advance(10),c=2<c.major?new g(c,b):new l(c,b),this.emit("metadata",c.read()));var c=b.offset,q=new e(new AV.Bitstream(b)),k=a.decode(q);if(!k)return this.emit("error","Could not find first frame.");
|
|
this.emit("format",{formatID:"mp3",sampleRate:k.samplerate,channelsPerFrame:k.nchannels(),bitrate:k.bitrate,floatingPoint:!0});q=this.parseDuration(k);b.advance(c-b.offset);this.dataSize=0;if(!q)this.on("end",function(){this.emit("duration",8*this.dataSize/k.bitrate*1E3|0)});this.sentInfo=!0}for(;b.available(1);)c=b.readSingleBuffer(b.remainingBytes()),this.dataSize+=c.length,this.emit("data",c)}});b.exports=d},{"./header":5,"./id3":7,"./stream":12}],4:[function(r,b,m){function g(){this.header=null;
|
|
this.options=0;this.sbsample=a.makeArray([2,36,32]);this.overlap=a.makeArray([2,32,18]);this.decoders=[]}var l=r("./header"),a=r("./utils");g.layers=[];g.prototype.decode=function(a){this.header&&this.header.flags&l.FLAGS.INCOMPLETE||(this.header=l.decode(a));this.header.flags&=~l.FLAGS.INCOMPLETE;var b=this.decoders[this.header.layer-1];if(!b){b=g.layers[this.header.layer];if(!b)throw Error("Layer "+this.header.layer+" is not supported.");b=this.decoders[this.header.layer-1]=new b}b.decode(a,this)};
|
|
b.exports=g},{"./header":5,"./utils":15}],5:[function(r,b,m){function g(){this.private_bits=this.flags=this.crc_target=this.crc_check=this.samplerate=this.bitrate=this.emphasis=this.mode_extension=this.mode=this.layer=0}var l=[[0,32E3,64E3,96E3,128E3,16E4,192E3,224E3,256E3,288E3,32E4,352E3,384E3,416E3,448E3],[0,32E3,48E3,56E3,64E3,8E4,96E3,112E3,128E3,16E4,192E3,224E3,256E3,32E4,384E3],[0,32E3,4E4,48E3,56E3,64E3,8E4,96E3,112E3,128E3,16E4,192E3,224E3,256E3,32E4],[0,32E3,48E3,56E3,64E3,8E4,96E3,112E3,
|
|
128E3,144E3,16E4,176E3,192E3,224E3,256E3],[0,8E3,16E3,24E3,32E3,4E4,48E3,56E3,64E3,8E4,96E3,112E3,128E3,144E3,16E4]],a=[44100,48E3,32E3];g.FLAGS={NPRIVATE_III:7,INCOMPLETE:8,PROTECTION:16,COPYRIGHT:32,ORIGINAL:64,PADDING:128,I_STEREO:256,MS_STEREO:512,FREEFORMAT:1024,LSF_EXT:4096,MC_EXT:8192,MPEG_2_5_EXT:16384};g.MODE={SINGLE_CHANNEL:0,DUAL_CHANNEL:1,JOINT_STEREO:2,STEREO:3};g.BUFFER_GUARD=8;g.BUFFER_MDLEN=2559+g.BUFFER_GUARD;g.prototype.copy=function(){var a=new g,b=Object.keys(this),l;for(l in b)a[l]=
|
|
this[l];return a};g.prototype.nchannels=function(){return 0===this.mode?1:2};g.prototype.nbsamples=function(){return 1===this.layer?12:3===this.layer&&this.flags&g.FLAGS.LSF_EXT?18:36};g.prototype.framesize=function(){if(0===this.bitrate)return null;var a=this.flags&g.FLAGS.PADDING?1:0;switch(this.layer){case 1:var b=12*this.bitrate/this.samplerate|0;return 4*(b+a);case 2:return b=144*this.bitrate/this.samplerate|0,b+a;default:return b=144*this.bitrate/(this.samplerate<<(this.flags&g.FLAGS.LSF_EXT?
|
|
1:0))|0,b+a}};g.prototype.decode=function(b){this.private_bits=this.flags=0;b.advance(11);0===b.read(1)&&(this.flags|=g.FLAGS.MPEG_2_5_EXT);if(0===b.read(1))this.flags|=g.FLAGS.LSF_EXT;else if(this.flags&g.FLAGS.MPEG_2_5_EXT)throw new AV.UnderflowError;this.layer=4-b.read(2);if(4===this.layer)throw Error("Invalid layer");0===b.read(1)&&(this.flags|=g.FLAGS.PROTECTION);var d=b.read(4);if(15===d)throw Error("Invalid bitrate");this.bitrate=this.flags&g.FLAGS.LSF_EXT?l[3+(this.layer>>1)][d]:l[this.layer-
|
|
1][d];d=b.read(2);if(3===d)throw Error("Invalid sampling frequency");this.samplerate=a[d];this.flags&g.FLAGS.LSF_EXT&&(this.samplerate/=2,this.flags&g.FLAGS.MPEG_2_5_EXT&&(this.samplerate/=2));b.read(1)&&(this.flags|=g.FLAGS.PADDING);b.read(1)&&(this.private_bits|=256);this.mode=3-b.read(2);this.mode_extension=b.read(2);b.read(1)&&(this.flags|=g.FLAGS.COPYRIGHT);b.read(1)&&(this.flags|=g.FLAGS.ORIGINAL);this.emphasis=b.read(2);this.flags&g.FLAGS.PROTECTION&&(this.crc_target=b.read(16))};g.decode=
|
|
function(a){for(var b=a.next_frame,l=!0,h=null;l;){l=!1;if(a.sync){if(!a.available(g.BUFFER_GUARD))throw a.next_frame=b,new AV.UnderflowError;if(255!==a.getU8(b)||224!==(a.getU8(b+1)&224))throw a.this_frame=b,a.next_frame=b+1,new AV.UnderflowError;}else{a.seek(8*b);if(!a.doSync())throw new AV.UnderflowError;b=a.nextByte()}a.this_frame=b;a.next_frame=b+1;a.seek(8*a.this_frame);h=new g;h.decode(a);0===h.bitrate&&((0===a.freerate||!a.sync||3===h.layer&&64E4<a.freerate)&&g.free_bitrate(a,h),h.bitrate=
|
|
a.freerate,h.flags|=g.FLAGS.FREEFORMAT);var c=h.flags&g.FLAGS.PADDING?1:0,c=1===h.layer?4*((12*h.bitrate/h.samplerate<<0)+c):((3===h.layer&&h.flags&g.FLAGS.LSF_EXT?72:144)*h.bitrate/h.samplerate<<0)+c;if(!a.available(c+g.BUFFER_GUARD))throw a.next_frame=a.this_frame,new AV.UnderflowError;a.next_frame=a.this_frame+c;a.sync||(b=a.next_frame,255!==a.getU8(b)||224!==(a.getU8(b+1)&224)?(b=a.next_frame=a.this_frame+1,l=!0):a.sync=!0)}h.flags|=g.FLAGS.INCOMPLETE;return h};g.free_bitrate=function(a,b){for(var l=
|
|
b.flags&g.FLAGS.PADDING?1:0,h=3===b.layer&&b.flags&g.FLAGS.LSF_EXT?72:144,c=a.offset(),x=0;a.doSync();){var k=b.copy(),w=a.copy();if(k.decode(w)&&k.layer===b.layer&&k.samplerate===b.samplerate&&(x=a.nextByte()-a.this_frame,x=1===b.layer?b.samplerate*(x-4*l+4)/48/1E3|0:b.samplerate*(x-l+1)/h/1E3|0,8<=x))break;a.advance(8)}a.seek(c);if(8>x||3===b.layer&&640<x)throw new AV.UnderflowError;a.freerate=1E3*x};b.exports=g},{}],6:[function(r,b,m){function g(a,b,k){this.table=a;this.linbits=b;this.startbits=
|
|
k}b=function(a,b){return{"final":0,ptr:{bits:b,offset:a}}};var l=function(a,b,k,c,d){return{"final":1,value:{v:a,w:b,x:k,y:c,hlen:d}}};r=[b(16,2),b(20,2),b(24,1),b(26,1),l(0,0,1,0,4),l(0,0,0,1,4),l(0,1,0,0,4),l(1,0,0,0,4),l(0,0,0,0,1),l(0,0,0,0,1),l(0,0,0,0,1),l(0,0,0,0,1),l(0,0,0,0,1),l(0,0,0,0,1),l(0,0,0,0,1),l(0,0,0,0,1),l(1,0,1,1,2),l(1,1,1,1,2),l(1,1,0,1,2),l(1,1,1,0,2),l(0,1,1,1,2),l(0,1,0,1,2),l(1,0,0,1,1),l(1,0,0,1,1),l(0,1,1,0,1),l(0,0,1,1,1),l(1,0,1,0,1),l(1,1,0,0,1)];var l=[l(1,1,1,1,4),
|
|
l(1,1,1,0,4),l(1,1,0,1,4),l(1,1,0,0,4),l(1,0,1,1,4),l(1,0,1,0,4),l(1,0,0,1,4),l(1,0,0,0,4),l(0,1,1,1,4),l(0,1,1,0,4),l(0,1,0,1,4),l(0,1,0,0,4),l(0,0,1,1,4),l(0,0,1,0,4),l(0,0,0,1,4),l(0,0,0,0,4)],a=function(a,b,k){return{"final":1,value:{x:a,y:b,hlen:k}}},e=[a(0,0,0)],d=[a(1,1,3),a(0,1,3),a(1,0,2),a(1,0,2),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1)],q=[b(8,3),a(1,1,3),a(0,1,3),a(1,0,3),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(2,2,3),a(0,2,3),a(1,2,2),a(1,2,2),a(2,1,2),a(2,1,2),a(2,0,2),a(2,0,2)],h=[b(8,3),
|
|
a(1,0,3),a(1,1,2),a(1,1,2),a(0,1,2),a(0,1,2),a(0,0,2),a(0,0,2),a(2,2,3),a(0,2,3),a(1,2,2),a(1,2,2),a(2,1,2),a(2,1,2),a(2,0,2),a(2,0,2)],c=[b(8,4),a(1,1,3),a(0,1,3),a(1,0,3),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),b(24,1),a(3,2,4),a(3,1,3),a(3,1,3),a(1,3,4),a(0,3,4),a(3,0,4),a(2,2,4),a(1,2,3),a(1,2,3),a(2,1,3),a(2,1,3),a(0,2,3),a(0,2,3),a(2,0,3),a(2,0,3),a(3,3,1),a(2,3,1)],x=[b(16,3),b(24,1),b(26,1),a(1,2,4),a(2,1,4),a(2,0,4),a(0,1,3),a(0,1,3),a(1,1,2),a(1,1,2),a(1,1,2),a(1,1,2),a(1,0,3),a(1,0,3),a(0,
|
|
0,3),a(0,0,3),a(3,3,3),a(0,3,3),a(2,3,2),a(2,3,2),a(3,2,2),a(3,2,2),a(3,0,2),a(3,0,2),a(1,3,1),a(3,1,1),a(2,2,1),a(0,2,1)],k=[b(16,4),b(32,4),b(48,2),a(1,1,4),a(0,1,3),a(0,1,3),a(1,0,3),a(1,0,3),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),b(52,2),b(56,1),b(58,1),a(1,5,4),a(5,1,4),b(60,1),a(5,0,4),b(62,1),a(2,4,4),a(4,2,4),a(1,4,3),a(1,4,3),a(4,1,3),a(4,1,3),a(4,0,3),a(4,0,3),a(0,4,4),a(2,3,4),a(3,2,4),a(0,3,4),a(1,3,3),a(1,3,3),a(3,1,3),a(3,1,3),a(3,0,3),a(3,0,3),a(2,2,
|
|
3),a(2,2,3),a(1,2,2),a(1,2,2),a(1,2,2),a(1,2,2),a(2,1,1),a(2,1,1),a(0,2,2),a(2,0,2),a(5,5,2),a(4,5,2),a(5,4,2),a(5,3,2),a(3,5,1),a(4,4,1),a(2,5,1),a(5,2,1),a(0,5,1),a(3,4,1),a(4,3,1),a(3,3,1)],w=[b(16,4),b(32,4),a(1,2,4),a(2,1,4),a(1,1,2),a(1,1,2),a(1,1,2),a(1,1,2),a(0,1,3),a(0,1,3),a(1,0,3),a(1,0,3),a(0,0,2),a(0,0,2),a(0,0,2),a(0,0,2),b(48,3),b(56,2),b(60,1),a(1,5,4),a(5,1,4),b(62,1),b(64,1),a(2,4,4),a(4,2,4),a(1,4,4),a(4,1,3),a(4,1,3),a(0,4,4),a(4,0,4),a(2,3,4),a(3,2,4),a(1,3,4),a(3,1,4),a(0,3,
|
|
4),a(3,0,4),a(2,2,2),a(2,2,2),a(2,2,2),a(2,2,2),a(0,2,2),a(0,2,2),a(0,2,2),a(0,2,2),a(2,0,2),a(2,0,2),a(2,0,2),a(2,0,2),a(5,5,3),a(5,4,3),a(4,5,2),a(4,5,2),a(5,3,1),a(5,3,1),a(5,3,1),a(5,3,1),a(3,5,2),a(4,4,2),a(2,5,1),a(2,5,1),a(5,2,1),a(0,5,1),a(3,4,1),a(4,3,1),a(5,0,1),a(3,3,1)],t=[b(16,4),b(32,3),b(40,2),b(44,2),b(48,1),a(1,2,4),a(2,1,4),a(2,0,4),a(1,1,3),a(1,1,3),a(0,1,3),a(0,1,3),a(1,0,3),a(1,0,3),a(0,0,3),a(0,0,3),b(50,1),a(3,5,4),a(5,3,4),b(52,1),a(4,4,4),a(2,5,4),a(5,2,4),a(1,5,4),a(5,1,
|
|
3),a(5,1,3),a(3,4,3),a(3,4,3),a(4,3,3),a(4,3,3),a(5,0,4),a(0,4,4),a(2,4,3),a(4,2,3),a(3,3,3),a(4,0,3),a(1,4,2),a(1,4,2),a(4,1,2),a(4,1,2),a(2,3,2),a(3,2,2),a(1,3,1),a(1,3,1),a(3,1,1),a(3,1,1),a(0,3,2),a(3,0,2),a(2,2,1),a(0,2,1),a(5,5,1),a(4,5,1),a(5,4,1),a(0,5,1)],u=[b(16,4),b(32,4),b(48,2),a(1,1,4),a(0,1,3),a(0,1,3),a(1,0,3),a(1,0,3),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),b(52,3),b(60,2),b(64,3),b(72,1),b(74,2),b(78,2),b(82,2),a(1,7,4),a(7,1,4),b(86,1),b(88,2),b(92,
|
|
2),a(1,6,4),a(6,1,4),a(6,0,4),b(96,1),b(98,1),b(100,1),a(1,4,4),a(4,1,4),a(4,0,4),a(2,3,4),a(3,2,4),a(0,3,4),a(1,3,3),a(1,3,3),a(3,1,3),a(3,1,3),a(3,0,3),a(3,0,3),a(2,2,3),a(2,2,3),a(1,2,2),a(2,1,2),a(0,2,2),a(2,0,2),a(7,7,3),a(6,7,3),a(7,6,3),a(5,7,3),a(7,5,3),a(6,6,3),a(4,7,2),a(4,7,2),a(7,4,2),a(5,6,2),a(6,5,2),a(3,7,2),a(7,3,2),a(7,3,2),a(4,6,2),a(4,6,2),a(5,5,3),a(5,4,3),a(6,3,2),a(6,3,2),a(2,7,1),a(7,2,1),a(6,4,2),a(0,7,2),a(7,0,1),a(7,0,1),a(6,2,1),a(6,2,1),a(4,5,2),a(3,5,2),a(0,6,1),a(0,6,
|
|
1),a(5,3,2),a(4,4,2),a(3,6,1),a(2,6,1),a(2,5,2),a(5,2,2),a(1,5,1),a(1,5,1),a(5,1,1),a(5,1,1),a(3,4,2),a(4,3,2),a(0,5,1),a(5,0,1),a(2,4,1),a(4,2,1),a(3,3,1),a(0,4,1)],H=[b(16,4),b(32,4),b(48,4),b(64,3),a(1,2,4),b(72,1),a(1,1,3),a(1,1,3),a(0,1,3),a(0,1,3),a(1,0,3),a(1,0,3),a(0,0,2),a(0,0,2),a(0,0,2),a(0,0,2),b(74,2),b(78,3),b(86,2),b(90,1),b(92,2),a(2,7,4),a(7,2,4),b(96,1),a(7,1,3),a(7,1,3),a(1,7,4),a(7,0,4),a(3,6,4),a(6,3,4),a(6,0,4),b(98,1),b(100,1),a(1,5,4),a(6,2,3),a(6,2,3),a(2,6,4),a(0,6,4),a(1,
|
|
6,3),a(1,6,3),a(6,1,3),a(6,1,3),a(5,1,4),a(3,4,4),a(5,0,4),b(102,1),a(2,4,4),a(4,2,4),a(1,4,4),a(4,1,4),a(0,4,4),a(4,0,4),a(2,3,3),a(2,3,3),a(3,2,3),a(3,2,3),a(1,3,2),a(1,3,2),a(1,3,2),a(1,3,2),a(3,1,2),a(3,1,2),a(3,1,2),a(3,1,2),a(0,3,3),a(3,0,3),a(2,2,2),a(2,2,2),a(2,1,1),a(2,1,1),a(2,1,1),a(2,1,1),a(0,2,1),a(2,0,1),a(7,7,2),a(6,7,2),a(7,6,2),a(7,5,2),a(6,6,2),a(6,6,2),a(4,7,2),a(4,7,2),a(7,4,2),a(7,4,2),a(5,7,3),a(5,5,3),a(5,6,2),a(6,5,2),a(3,7,1),a(3,7,1),a(7,3,1),a(4,6,1),a(4,5,2),a(5,4,2),a(3,
|
|
5,2),a(5,3,2),a(6,4,1),a(0,7,1),a(4,4,1),a(2,5,1),a(5,2,1),a(0,5,1),a(4,3,1),a(3,3,1)],A=[b(16,4),b(32,4),b(48,4),b(64,2),b(68,3),b(76,1),a(1,2,4),a(2,1,4),b(78,1),a(0,0,4),a(1,1,3),a(1,1,3),a(0,1,3),a(0,1,3),a(1,0,3),a(1,0,3),b(80,2),b(84,1),b(86,1),b(88,1),a(5,6,4),a(3,7,4),b(90,1),a(2,7,4),a(7,2,4),a(4,6,4),a(6,4,4),a(1,7,4),a(7,1,4),b(92,1),a(3,6,4),a(6,3,4),a(4,5,4),a(5,4,4),a(4,4,4),b(94,1),a(2,6,3),a(2,6,3),a(6,2,3),a(6,2,3),a(6,1,3),a(6,1,3),a(1,6,4),a(6,0,4),a(3,5,4),a(5,3,4),a(2,5,4),a(5,
|
|
2,4),a(1,5,3),a(1,5,3),a(5,1,3),a(5,1,3),a(3,4,3),a(3,4,3),a(4,3,3),a(4,3,3),a(5,0,4),a(0,4,4),a(2,4,3),a(2,4,3),a(4,2,3),a(4,2,3),a(1,4,3),a(1,4,3),a(3,3,2),a(4,1,2),a(2,3,2),a(3,2,2),a(4,0,3),a(0,3,3),a(3,0,2),a(3,0,2),a(1,3,1),a(1,3,1),a(1,3,1),a(1,3,1),a(3,1,1),a(2,2,1),a(0,2,1),a(2,0,1),a(7,7,2),a(6,7,2),a(7,6,1),a(7,6,1),a(5,7,1),a(7,5,1),a(6,6,1),a(4,7,1),a(7,4,1),a(6,5,1),a(7,3,1),a(5,5,1),a(0,7,1),a(7,0,1),a(0,6,1),a(0,5,1)],M=[b(16,4),b(32,4),b(48,4),b(64,2),a(1,1,4),a(0,1,4),a(1,0,3),a(1,
|
|
0,3),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),b(68,4),b(84,4),b(100,4),b(116,4),b(132,4),b(148,4),b(164,3),b(172,3),b(180,3),b(188,3),b(196,3),b(204,3),b(212,1),b(214,2),b(218,3),b(226,1),b(228,2),b(232,2),b(236,2),b(240,2),a(8,1,4),b(244,1),b(246,1),b(248,1),b(250,2),b(254,1),a(1,5,4),a(5,1,4),b(256,1),b(258,1),b(260,1),a(1,4,4),a(4,1,3),a(4,1,3),a(0,4,4),a(4,0,4),a(2,3,4),a(3,2,4),a(1,3,3),a(1,3,3),a(3,1,3),a(3,1,3),a(0,3,3),a(0,3,3),a(3,0,3),a(3,0,3),a(2,2,3),a(2,
|
|
2,3),a(1,2,2),a(2,1,2),a(0,2,2),a(2,0,2),b(262,4),b(278,4),b(294,4),b(310,3),b(318,2),b(322,2),b(326,3),b(334,2),b(338,1),b(340,2),b(344,2),b(348,2),b(352,2),b(356,2),a(1,15,4),a(15,1,4),a(15,0,4),b(360,1),b(362,1),b(364,1),a(14,2,4),b(366,1),a(1,14,4),a(14,1,4),b(368,1),b(370,1),b(372,1),b(374,1),b(376,1),b(378,1),a(12,6,4),a(3,13,4),b(380,1),a(2,13,4),a(13,2,4),a(1,13,4),a(11,7,4),b(382,1),b(384,1),a(12,3,4),b(386,1),a(4,11,4),a(13,1,3),a(13,1,3),a(0,13,4),a(13,0,4),a(8,10,4),a(10,8,4),a(4,12,4),
|
|
a(12,4,4),a(6,11,4),a(11,6,4),a(3,12,3),a(3,12,3),a(2,12,3),a(2,12,3),a(12,2,3),a(12,2,3),a(5,11,3),a(5,11,3),a(11,5,4),a(8,9,4),a(1,12,3),a(1,12,3),a(12,1,3),a(12,1,3),a(9,8,4),a(0,12,4),a(12,0,3),a(12,0,3),a(11,4,4),a(6,10,4),a(10,6,4),a(7,9,4),a(3,11,3),a(3,11,3),a(11,3,3),a(11,3,3),a(8,8,4),a(5,10,4),a(2,11,3),a(2,11,3),a(10,5,4),a(6,9,4),a(10,4,3),a(10,4,3),a(7,8,4),a(8,7,4),a(9,4,3),a(9,4,3),a(7,7,4),a(7,6,4),a(11,2,2),a(11,2,2),a(11,2,2),a(11,2,2),a(1,11,2),a(1,11,2),a(11,1,2),a(11,1,2),a(0,
|
|
11,3),a(11,0,3),a(9,6,3),a(4,10,3),a(3,10,3),a(10,3,3),a(5,9,3),a(9,5,3),a(2,10,2),a(2,10,2),a(10,2,2),a(10,2,2),a(1,10,2),a(1,10,2),a(10,1,2),a(10,1,2),a(0,10,3),a(6,8,3),a(10,0,2),a(10,0,2),a(8,6,3),a(4,9,3),a(9,3,2),a(9,3,2),a(3,9,3),a(5,8,3),a(8,5,3),a(6,7,3),a(2,9,2),a(2,9,2),a(9,2,2),a(9,2,2),a(5,7,3),a(7,5,3),a(3,8,2),a(3,8,2),a(8,3,2),a(8,3,2),a(6,6,3),a(4,7,3),a(7,4,3),a(5,6,3),a(6,5,3),a(7,3,3),a(1,9,1),a(9,1,1),a(0,9,2),a(9,0,2),a(4,8,2),a(8,4,2),a(7,2,2),a(7,2,2),a(4,6,3),a(6,4,3),a(2,
|
|
8,1),a(2,8,1),a(2,8,1),a(2,8,1),a(8,2,1),a(1,8,1),a(3,7,2),a(2,7,2),a(1,7,1),a(1,7,1),a(7,1,1),a(7,1,1),a(5,5,2),a(0,7,2),a(7,0,2),a(3,6,2),a(6,3,2),a(4,5,2),a(5,4,2),a(2,6,2),a(6,2,2),a(3,5,2),a(0,8,1),a(8,0,1),a(1,6,1),a(6,1,1),a(0,6,1),a(6,0,1),a(5,3,2),a(4,4,2),a(2,5,1),a(2,5,1),a(5,2,1),a(0,5,1),a(3,4,1),a(4,3,1),a(5,0,1),a(2,4,1),a(4,2,1),a(3,3,1),b(388,3),a(15,15,4),a(14,15,4),a(13,15,4),a(14,14,4),a(12,15,4),a(13,14,4),a(11,15,4),a(15,11,4),a(12,14,4),a(13,12,4),b(396,1),a(14,12,3),a(14,12,
|
|
3),a(13,13,3),a(13,13,3),a(15,10,4),a(12,13,4),a(11,14,3),a(11,14,3),a(14,11,3),a(14,11,3),a(9,15,3),a(9,15,3),a(15,9,3),a(15,9,3),a(14,10,3),a(14,10,3),a(11,13,3),a(11,13,3),a(13,11,3),a(13,11,3),a(8,15,3),a(8,15,3),a(15,8,3),a(15,8,3),a(12,12,3),a(12,12,3),a(10,14,4),a(9,14,4),a(8,14,3),a(8,14,3),a(7,15,4),a(7,14,4),a(15,7,2),a(15,7,2),a(15,7,2),a(15,7,2),a(13,10,2),a(13,10,2),a(10,13,3),a(11,12,3),a(12,11,3),a(15,6,3),a(6,15,2),a(6,15,2),a(14,8,2),a(5,15,2),a(9,13,2),a(13,9,2),a(15,5,2),a(14,7,
|
|
2),a(10,12,2),a(11,11,2),a(4,15,2),a(4,15,2),a(15,4,2),a(15,4,2),a(12,10,3),a(14,6,3),a(15,3,2),a(15,3,2),a(3,15,1),a(3,15,1),a(8,13,2),a(13,8,2),a(2,15,1),a(15,2,1),a(6,14,2),a(9,12,2),a(0,15,1),a(0,15,1),a(12,9,2),a(5,14,2),a(10,11,1),a(10,11,1),a(7,13,2),a(13,7,2),a(4,14,1),a(4,14,1),a(12,8,2),a(13,6,2),a(3,14,1),a(3,14,1),a(11,9,1),a(11,9,1),a(9,11,2),a(10,10,2),a(11,10,1),a(14,5,1),a(14,4,1),a(8,12,1),a(6,13,1),a(14,3,1),a(2,14,1),a(0,14,1),a(14,0,1),a(5,13,1),a(13,5,1),a(7,12,1),a(12,7,1),a(4,
|
|
13,1),a(8,11,1),a(11,8,1),a(13,4,1),a(9,10,1),a(10,9,1),a(6,12,1),a(13,3,1),a(7,11,1),a(5,12,1),a(12,5,1),a(9,9,1),a(7,10,1),a(10,7,1),a(9,7,1),a(15,14,3),a(15,12,3),a(15,13,2),a(15,13,2),a(14,13,1),a(14,13,1),a(14,13,1),a(14,13,1),a(10,15,1),a(14,9,1)],n=[b(16,4),b(32,4),b(48,4),b(64,4),b(80,4),b(96,3),b(104,3),b(112,2),b(116,1),b(118,1),a(1,1,3),a(1,1,3),a(0,1,4),a(1,0,4),a(0,0,3),a(0,0,3),b(120,4),b(136,4),b(152,4),b(168,4),b(184,4),b(200,3),b(208,3),b(216,4),b(232,3),b(240,3),b(248,3),b(256,3),
|
|
b(264,2),b(268,3),b(276,3),b(284,2),b(288,2),b(292,2),b(296,2),b(300,2),b(304,2),b(308,2),b(312,2),b(316,2),b(320,1),b(322,1),b(324,1),b(326,2),b(330,1),b(332,1),b(334,2),b(338,1),b(340,1),b(342,1),a(9,1,4),b(344,1),b(346,1),b(348,1),b(350,1),b(352,1),a(2,8,4),a(8,2,4),a(1,8,4),a(8,1,4),b(354,1),b(356,1),b(358,1),b(360,1),a(2,7,4),a(7,2,4),a(6,4,4),a(1,7,4),a(5,5,4),a(7,1,4),b(362,1),a(3,6,4),a(6,3,4),a(4,5,4),a(5,4,4),a(2,6,4),a(6,2,4),a(1,6,4),b(364,1),a(3,5,4),a(6,1,3),a(6,1,3),a(5,3,4),a(4,4,
|
|
4),a(2,5,3),a(2,5,3),a(5,2,3),a(5,2,3),a(1,5,3),a(1,5,3),a(5,1,3),a(5,1,3),a(0,5,4),a(5,0,4),a(3,4,3),a(3,4,3),a(4,3,3),a(2,4,3),a(4,2,3),a(3,3,3),a(4,1,2),a(4,1,2),a(1,4,3),a(0,4,3),a(2,3,2),a(2,3,2),a(3,2,2),a(3,2,2),a(4,0,3),a(0,3,3),a(1,3,2),a(1,3,2),a(3,1,2),a(3,0,2),a(2,2,1),a(2,2,1),a(1,2,1),a(2,1,1),a(0,2,1),a(2,0,1),b(366,1),b(368,1),a(14,14,4),b(370,1),b(372,1),b(374,1),a(15,11,4),b(376,1),a(13,13,4),a(10,15,4),a(15,10,4),a(11,14,4),a(14,11,4),a(12,13,4),a(13,12,4),a(9,15,4),a(15,9,4),a(14,
|
|
10,4),a(11,13,4),a(13,11,4),a(8,15,4),a(15,8,4),a(12,12,4),a(9,14,4),a(14,9,4),a(7,15,4),a(15,7,4),a(10,13,4),a(13,10,4),a(11,12,4),a(6,15,4),b(378,1),a(12,11,3),a(12,11,3),a(15,6,3),a(15,6,3),a(8,14,4),a(14,8,4),a(5,15,4),a(9,13,4),a(15,5,3),a(15,5,3),a(7,14,3),a(7,14,3),a(14,7,3),a(14,7,3),a(10,12,3),a(10,12,3),a(12,10,3),a(12,10,3),a(11,11,3),a(11,11,3),a(13,9,4),a(8,13,4),a(4,15,3),a(4,15,3),a(15,4,3),a(15,4,3),a(3,15,3),a(3,15,3),a(15,3,3),a(15,3,3),a(13,8,3),a(13,8,3),a(14,6,3),a(14,6,3),a(2,
|
|
15,3),a(2,15,3),a(15,2,3),a(15,2,3),a(6,14,4),a(15,0,4),a(1,15,3),a(1,15,3),a(15,1,3),a(15,1,3),a(9,12,3),a(9,12,3),a(12,9,3),a(12,9,3),a(5,14,3),a(10,11,3),a(11,10,3),a(14,5,3),a(7,13,3),a(13,7,3),a(4,14,3),a(14,4,3),a(8,12,3),a(12,8,3),a(3,14,3),a(6,13,3),a(13,6,3),a(14,3,3),a(9,11,3),a(11,9,3),a(2,14,3),a(2,14,3),a(10,10,3),a(10,10,3),a(14,2,3),a(14,2,3),a(1,14,3),a(1,14,3),a(14,1,3),a(14,1,3),a(0,14,4),a(14,0,4),a(5,13,3),a(5,13,3),a(13,5,3),a(13,5,3),a(7,12,3),a(12,7,3),a(4,13,3),a(8,11,3),a(13,
|
|
4,2),a(13,4,2),a(11,8,3),a(9,10,3),a(10,9,3),a(6,12,3),a(12,6,3),a(3,13,3),a(13,3,2),a(13,3,2),a(13,2,2),a(13,2,2),a(2,13,3),a(0,13,3),a(1,13,2),a(1,13,2),a(7,11,2),a(7,11,2),a(11,7,2),a(11,7,2),a(13,1,2),a(13,1,2),a(5,12,3),a(13,0,3),a(12,5,2),a(12,5,2),a(8,10,2),a(8,10,2),a(10,8,2),a(4,12,2),a(12,4,2),a(6,11,2),a(11,6,2),a(11,6,2),a(9,9,3),a(0,12,3),a(3,12,2),a(3,12,2),a(12,3,2),a(12,3,2),a(7,10,2),a(7,10,2),a(10,7,2),a(10,7,2),a(10,6,2),a(10,6,2),a(12,0,3),a(0,11,3),a(12,2,1),a(12,2,1),a(2,12,
|
|
2),a(5,11,2),a(11,5,2),a(1,12,2),a(8,9,2),a(9,8,2),a(12,1,2),a(4,11,2),a(11,4,2),a(6,10,2),a(3,11,2),a(7,9,2),a(11,3,1),a(11,3,1),a(9,7,2),a(8,8,2),a(2,11,2),a(5,10,2),a(11,2,1),a(11,2,1),a(10,5,2),a(1,11,2),a(11,1,1),a(11,1,1),a(11,0,2),a(6,9,2),a(9,6,2),a(4,10,2),a(10,4,2),a(7,8,2),a(8,7,2),a(3,10,2),a(10,3,1),a(10,3,1),a(5,9,1),a(9,5,1),a(2,10,1),a(10,2,1),a(1,10,1),a(10,1,1),a(0,10,2),a(10,0,2),a(6,8,1),a(6,8,1),a(8,6,1),a(4,9,1),a(9,4,1),a(3,9,1),a(9,3,1),a(9,3,1),a(7,7,2),a(0,9,2),a(5,8,1),
|
|
a(8,5,1),a(2,9,1),a(6,7,1),a(7,6,1),a(9,2,1),a(1,9,1),a(9,0,1),a(4,8,1),a(8,4,1),a(5,7,1),a(7,5,1),a(3,8,1),a(8,3,1),a(6,6,1),a(4,7,1),a(7,4,1),a(0,8,1),a(8,0,1),a(5,6,1),a(6,5,1),a(3,7,1),a(7,3,1),a(4,6,1),a(0,7,1),a(7,0,1),a(0,6,1),a(6,0,1),a(15,15,1),a(14,15,1),a(15,14,1),a(13,15,1),a(15,13,1),a(12,15,1),a(15,12,1),a(13,14,1),a(14,13,1),a(11,15,1),a(12,14,1),a(14,12,1),a(10,14,1),a(0,15,1)],v=[b(16,4),b(32,4),b(48,4),b(64,2),a(1,1,4),a(0,1,4),a(1,0,3),a(1,0,3),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,
|
|
1),a(0,0,1),a(0,0,1),a(0,0,1),a(0,0,1),b(68,3),b(76,3),b(84,2),a(15,15,4),b(88,2),b(92,1),b(94,4),a(15,2,4),b(110,1),a(1,15,4),a(15,1,4),b(112,4),b(128,4),b(144,4),b(160,4),b(176,4),b(192,4),b(208,3),b(216,3),b(224,3),b(232,3),b(240,3),b(248,3),b(256,3),b(264,2),b(268,2),b(272,1),b(274,2),b(278,2),b(282,1),a(5,1,4),b(284,1),b(286,1),b(288,1),b(290,1),a(1,4,4),a(4,1,4),b(292,1),a(2,3,4),a(3,2,4),a(1,3,3),a(1,3,3),a(3,1,3),a(3,1,3),a(0,3,4),a(3,0,4),a(2,2,3),a(2,2,3),a(1,2,2),a(2,1,2),a(0,2,2),a(2,
|
|
0,2),a(14,15,3),a(15,14,3),a(13,15,3),a(15,13,3),a(12,15,3),a(15,12,3),a(11,15,3),a(15,11,3),a(10,15,2),a(10,15,2),a(15,10,3),a(9,15,3),a(15,9,3),a(15,8,3),a(8,15,2),a(8,15,2),a(7,15,2),a(15,7,2),a(6,15,2),a(15,6,2),a(5,15,2),a(15,5,2),a(4,15,1),a(4,15,1),a(15,4,1),a(15,3,1),a(15,0,1),a(15,0,1),a(15,0,1),a(15,0,1),a(15,0,1),a(15,0,1),a(15,0,1),a(15,0,1),a(3,15,2),a(3,15,2),a(3,15,2),a(3,15,2),b(294,4),b(310,3),b(318,3),b(326,3),a(2,15,1),a(0,15,1),b(334,2),b(338,2),b(342,2),b(346,1),b(348,2),b(352,
|
|
2),b(356,1),b(358,2),b(362,2),b(366,2),b(370,2),a(14,3,4),b(374,1),b(376,1),b(378,1),b(380,1),b(382,1),b(384,1),b(386,1),a(0,13,4),b(388,1),b(390,1),b(392,1),a(3,12,4),b(394,1),a(1,12,4),a(12,0,4),b(396,1),a(14,2,3),a(14,2,3),a(2,14,4),a(1,14,4),a(13,3,4),a(2,13,4),a(13,2,4),a(13,1,4),a(3,11,4),b(398,1),a(1,13,3),a(1,13,3),a(12,4,4),a(6,11,4),a(12,3,4),a(10,7,4),a(2,12,3),a(2,12,3),a(12,2,4),a(11,5,4),a(12,1,4),a(0,12,4),a(4,11,4),a(11,4,4),a(6,10,4),a(10,6,4),a(11,3,3),a(11,3,3),a(5,10,4),a(10,5,
|
|
4),a(2,11,3),a(2,11,3),a(11,2,3),a(11,2,3),a(1,11,3),a(1,11,3),a(11,1,3),a(11,1,3),a(0,11,4),a(11,0,4),a(6,9,4),a(9,6,4),a(4,10,4),a(10,4,4),a(7,8,4),a(8,7,4),a(10,3,3),a(10,3,3),a(3,10,4),a(5,9,4),a(2,10,3),a(2,10,3),a(9,5,4),a(6,8,4),a(10,1,3),a(10,1,3),a(8,6,4),a(7,7,4),a(9,4,3),a(9,4,3),a(4,9,4),a(5,7,4),a(6,7,3),a(6,7,3),a(10,2,2),a(10,2,2),a(10,2,2),a(10,2,2),a(1,10,2),a(1,10,2),a(0,10,3),a(10,0,3),a(3,9,3),a(9,3,3),a(5,8,3),a(8,5,3),a(2,9,2),a(2,9,2),a(9,2,2),a(9,2,2),a(7,6,3),a(0,9,3),a(1,
|
|
9,2),a(1,9,2),a(9,1,2),a(9,1,2),a(9,0,3),a(4,8,3),a(8,4,3),a(7,5,3),a(3,8,3),a(8,3,3),a(6,6,3),a(2,8,3),a(8,2,2),a(8,2,2),a(4,7,3),a(7,4,3),a(1,8,2),a(1,8,2),a(8,1,2),a(8,1,2),a(8,0,2),a(8,0,2),a(0,8,3),a(5,6,3),a(3,7,2),a(3,7,2),a(7,3,2),a(7,3,2),a(6,5,3),a(4,6,3),a(2,7,2),a(2,7,2),a(7,2,2),a(7,2,2),a(6,4,3),a(5,5,3),a(0,7,2),a(0,7,2),a(1,7,1),a(1,7,1),a(1,7,1),a(1,7,1),a(7,1,1),a(7,1,1),a(7,0,2),a(3,6,2),a(6,3,2),a(4,5,2),a(5,4,2),a(2,6,2),a(6,2,1),a(1,6,1),a(6,1,1),a(6,1,1),a(0,6,2),a(6,0,2),a(5,
|
|
3,1),a(5,3,1),a(3,5,2),a(4,4,2),a(2,5,1),a(5,2,1),a(1,5,1),a(0,5,1),a(3,4,1),a(4,3,1),a(5,0,1),a(2,4,1),a(4,2,1),a(3,3,1),a(0,4,1),a(4,0,1),a(12,14,4),b(400,1),a(13,14,3),a(13,14,3),a(14,9,3),a(14,9,3),a(14,10,4),a(13,9,4),a(14,14,2),a(14,14,2),a(14,14,2),a(14,14,2),a(14,13,3),a(14,13,3),a(14,11,3),a(14,11,3),a(11,14,2),a(11,14,2),a(12,13,2),a(12,13,2),a(13,12,3),a(13,11,3),a(10,14,2),a(10,14,2),a(12,12,2),a(12,12,2),a(10,13,3),a(13,10,3),a(7,14,3),a(10,12,3),a(12,10,2),a(12,10,2),a(12,9,3),a(7,13,
|
|
3),a(5,14,2),a(5,14,2),a(11,13,1),a(11,13,1),a(11,13,1),a(11,13,1),a(9,14,1),a(9,14,1),a(11,12,2),a(12,11,2),a(8,14,2),a(14,8,2),a(9,13,2),a(14,7,2),a(11,11,2),a(8,13,2),a(13,8,2),a(6,14,2),a(14,6,1),a(9,12,1),a(10,11,2),a(11,10,2),a(14,5,2),a(13,7,2),a(4,14,1),a(4,14,1),a(14,4,2),a(8,12,2),a(12,8,1),a(3,14,1),a(6,13,1),a(6,13,1),a(13,6,2),a(9,11,2),a(11,9,2),a(10,10,2),a(14,1,1),a(14,1,1),a(13,4,1),a(13,4,1),a(11,8,2),a(10,9,2),a(7,11,1),a(7,11,1),a(11,7,2),a(13,0,2),a(0,14,1),a(14,0,1),a(5,13,1),
|
|
a(13,5,1),a(7,12,1),a(12,7,1),a(4,13,1),a(8,11,1),a(9,10,1),a(6,12,1),a(12,6,1),a(3,13,1),a(5,12,1),a(12,5,1),a(8,10,1),a(10,8,1),a(9,9,1),a(4,12,1),a(11,6,1),a(7,10,1),a(5,11,1),a(8,9,1),a(9,8,1),a(7,9,1),a(9,7,1),a(8,8,1),a(14,12,1),a(13,13,1)];b=[b(16,4),b(32,4),b(48,4),a(15,15,4),b(64,4),b(80,4),b(96,4),b(112,4),b(128,4),b(144,4),b(160,3),b(168,2),a(1,1,4),a(0,1,4),a(1,0,4),a(0,0,4),a(14,15,4),a(15,14,4),a(13,15,4),a(15,13,4),a(12,15,4),a(15,12,4),a(11,15,4),a(15,11,4),a(15,10,3),a(15,10,3),a(10,
|
|
15,4),a(9,15,4),a(15,9,3),a(15,9,3),a(15,8,3),a(15,8,3),a(8,15,4),a(7,15,4),a(15,7,3),a(15,7,3),a(6,15,3),a(6,15,3),a(15,6,3),a(15,6,3),a(5,15,3),a(5,15,3),a(15,5,3),a(15,5,3),a(4,15,3),a(4,15,3),a(15,4,3),a(15,4,3),a(3,15,3),a(3,15,3),a(15,3,3),a(15,3,3),a(2,15,3),a(2,15,3),a(15,2,3),a(15,2,3),a(15,1,3),a(15,1,3),a(1,15,4),a(15,0,4),b(172,3),b(180,3),b(188,3),b(196,3),b(204,4),b(220,3),b(228,3),b(236,3),b(244,2),b(248,2),b(252,2),b(256,2),b(260,2),b(264,2),b(268,2),b(272,2),b(276,2),b(280,3),b(288,
|
|
2),b(292,2),b(296,2),b(300,3),b(308,2),b(312,3),b(320,1),b(322,2),b(326,2),b(330,1),b(332,2),b(336,1),b(338,1),b(340,1),b(342,1),b(344,1),b(346,1),b(348,1),b(350,1),b(352,1),b(354,1),b(356,1),b(358,1),b(360,1),b(362,1),b(364,1),b(366,1),b(368,1),b(370,2),b(374,1),b(376,2),a(7,3,4),b(380,1),a(7,2,4),a(4,6,4),a(6,4,4),a(5,5,4),a(7,1,4),a(3,6,4),a(6,3,4),a(4,5,4),a(5,4,4),a(2,6,4),a(6,2,4),a(1,6,4),a(6,1,4),b(382,1),a(3,5,4),a(5,3,4),a(4,4,4),a(2,5,4),a(5,2,4),a(1,5,4),b(384,1),a(5,1,3),a(5,1,3),a(3,
|
|
4,4),a(4,3,4),a(2,4,3),a(2,4,3),a(4,2,3),a(4,2,3),a(3,3,3),a(3,3,3),a(1,4,3),a(1,4,3),a(4,1,3),a(4,1,3),a(0,4,4),a(4,0,4),a(2,3,3),a(2,3,3),a(3,2,3),a(3,2,3),a(1,3,2),a(1,3,2),a(1,3,2),a(1,3,2),a(3,1,2),a(3,1,2),a(3,1,2),a(3,1,2),a(0,3,3),a(3,0,3),a(2,2,2),a(2,2,2),a(1,2,1),a(1,2,1),a(1,2,1),a(1,2,1),a(2,1,1),a(2,1,1),a(0,2,2),a(2,0,2),a(0,15,1),a(0,15,1),a(0,15,1),a(0,15,1),a(14,14,3),a(13,14,3),a(14,13,3),a(12,14,3),a(14,12,3),a(13,13,3),a(11,14,3),a(14,11,3),a(12,13,3),a(13,12,3),a(10,14,3),a(14,
|
|
10,3),a(11,13,3),a(13,11,3),a(12,12,3),a(9,14,3),a(14,9,3),a(10,13,3),a(13,10,3),a(11,12,3),a(12,11,3),a(8,14,3),a(14,8,3),a(9,13,3),a(13,9,3),a(7,14,3),a(14,7,3),a(10,12,3),a(12,10,3),a(12,10,3),a(11,11,3),a(11,11,3),a(8,13,3),a(8,13,3),a(13,8,3),a(13,8,3),a(0,14,4),a(14,0,4),a(0,13,3),a(0,13,3),a(14,6,2),a(14,6,2),a(14,6,2),a(14,6,2),a(6,14,3),a(9,12,3),a(12,9,2),a(12,9,2),a(5,14,2),a(5,14,2),a(11,10,2),a(11,10,2),a(14,5,2),a(14,5,2),a(10,11,3),a(7,13,3),a(13,7,2),a(13,7,2),a(14,4,2),a(14,4,2),
|
|
a(8,12,2),a(8,12,2),a(12,8,2),a(12,8,2),a(4,14,3),a(2,14,3),a(3,14,2),a(3,14,2),a(6,13,2),a(13,6,2),a(14,3,2),a(9,11,2),a(11,9,2),a(10,10,2),a(14,2,2),a(1,14,2),a(14,1,2),a(5,13,2),a(13,5,2),a(7,12,2),a(12,7,2),a(4,13,2),a(8,11,2),a(11,8,2),a(13,4,2),a(9,10,2),a(10,9,2),a(6,12,2),a(12,6,2),a(3,13,2),a(13,3,2),a(2,13,2),a(13,2,2),a(1,13,2),a(7,11,2),a(11,7,2),a(13,1,2),a(5,12,2),a(12,5,2),a(8,10,2),a(10,8,2),a(9,9,2),a(4,12,2),a(12,4,2),a(6,11,2),a(6,11,2),a(11,6,2),a(11,6,2),a(13,0,3),a(0,12,3),a(3,
|
|
12,2),a(3,12,2),a(12,3,2),a(7,10,2),a(10,7,2),a(2,12,2),a(12,2,2),a(5,11,2),a(11,5,2),a(1,12,2),a(8,9,2),a(9,8,2),a(12,1,2),a(4,11,2),a(12,0,3),a(0,11,3),a(3,11,2),a(3,11,2),a(11,0,3),a(0,10,3),a(1,10,2),a(1,10,2),a(11,4,1),a(11,4,1),a(6,10,2),a(10,6,2),a(7,9,2),a(7,9,2),a(9,7,2),a(9,7,2),a(10,0,3),a(0,9,3),a(9,0,2),a(9,0,2),a(11,3,1),a(8,8,1),a(2,11,2),a(5,10,2),a(11,2,1),a(11,2,1),a(10,5,2),a(1,11,2),a(11,1,2),a(6,9,2),a(9,6,1),a(10,4,1),a(4,10,2),a(7,8,2),a(8,7,1),a(8,7,1),a(3,10,1),a(10,3,1),
|
|
a(5,9,1),a(9,5,1),a(2,10,1),a(10,2,1),a(10,1,1),a(6,8,1),a(8,6,1),a(7,7,1),a(4,9,1),a(9,4,1),a(3,9,1),a(9,3,1),a(5,8,1),a(8,5,1),a(2,9,1),a(6,7,1),a(7,6,1),a(9,2,1),a(1,9,1),a(9,1,1),a(4,8,1),a(8,4,1),a(5,7,1),a(7,5,1),a(3,8,1),a(8,3,1),a(6,6,1),a(2,8,1),a(8,2,1),a(1,8,1),a(4,7,1),a(7,4,1),a(8,1,1),a(8,1,1),a(0,8,2),a(8,0,2),a(5,6,1),a(6,5,1),a(1,7,1),a(1,7,1),a(0,7,2),a(7,0,2),a(3,7,1),a(2,7,1),a(0,6,1),a(6,0,1),a(0,5,1),a(5,0,1)];m.huff_quad_table=[r,l];m.huff_pair_table=[new g(e,0,0),new g(d,0,
|
|
3),new g(q,0,3),new g(h,0,3),null,new g(c,0,3),new g(x,0,4),new g(k,0,4),new g(w,0,4),new g(t,0,4),new g(u,0,4),new g(H,0,4),new g(A,0,4),new g(M,0,4),null,new g(n,0,4),new g(v,1,4),new g(v,2,4),new g(v,3,4),new g(v,4,4),new g(v,6,4),new g(v,8,4),new g(v,10,4),new g(v,13,4),new g(b,4,4),new g(b,5,4),new g(b,6,4),new g(b,7,4),new g(b,8,4),new g(b,9,4),new g(b,11,4),new g(b,13,4)]},{}],7:[function(r,b,m){var g=["latin1","utf16-bom","utf16-be","utf8"];r=AV.Base.extend({constructor:function(b,a){this.header=
|
|
b;this.stream=a;this.offset=0},read:function(){if(!this.data){this.data={};for(var b;b=this.readFrame();)b.key in this.data?(Array.isArray(this.data[b.key])||(this.data[b.key]=[this.data[b.key]]),this.data[b.key].push(b.value)):this.data[b.key]=b.value}return this.data},readFrame:function(){if(this.offset>=this.header.length)return null;var b=this.readHeader(),a=b.identifier;if(0===b.identifier.charCodeAt(0))return this.offset+=this.header.length+1,null;if(!this.frameTypes[a])for(var e in this.map)if(-1!==
|
|
this.map[e].indexOf(a)){a=e;break}this.frameTypes[a]?(a=this.decodeFrame(b,this.frameTypes[a]),e=Object.keys(a),1===e.length&&(a=a[e[0]]),a={value:a}):a={value:this.stream.readBuffer(Math.min(b.length,this.header.length-this.offset))};a.key=this.names[b.identifier]?this.names[b.identifier]:b.identifier;"coverArt"===a.key&&(a.value=a.value.data);this.offset+=10+b.length;return a},decodeFrame:function(b,a){var e=this.stream,d=e.offset,q=0,h={},c=Object.keys(a).length,x=0,k;for(k in a){var w=a[k],t=
|
|
b.length-(e.offset-d);x++;switch(k){case "encoding":q=e.readUInt8();continue;case "language":h.language=e.readString(3);continue}switch(w){case "latin1":h[k]=e.readString(x===c?t:null,"latin1");break;case "string":h[k]=e.readString(x===c?t:null,g[q]);break;case "binary":h[k]=e.readBuffer(t);break;case "int16":h[k]=e.readInt16();break;case "int8":h[k]=e.readInt8();break;case "int24":h[k]=e.readInt24();break;case "int32":h[k]=e.readInt32();break;case "int32+":h[k]=e.readInt32();if(4<t)throw Error("Seriously dude? Stop playing this song and get a life!");
|
|
break;case "date":w=e.readString(8);h[k]=new Date(w.slice(0,4),w.slice(4,6)-1,w.slice(6,8));break;case "frame_id":h[k]=e.readString(4);break;default:throw Error("Unknown key type "+w);}}t=b.length-(e.offset-d);0<t&&e.advance(t);return h}});m.ID3v23Stream=r.extend({readHeader:function(){var b=this.stream.readString(4),a=0;if(4===this.header.major)for(var e=0;4>e;e++)a=(a<<7)+(this.stream.readUInt8()&127);else a=this.stream.readUInt32();return{identifier:b,length:a,flags:this.stream.readUInt16()}},
|
|
map:{text:"TIT1 TIT2 TIT3 TALB TOAL TRCK TPOS TSST TSRC TPE1 TPE2 TPE3 TPE4 TOPE TEXT TOLY TCOM TMCL TIPL TENC TBPM TLEN TKEY TLAN TCON TFLT TMED TMOO TCOP TPRO TPUB TOWN TRSN TRSO TOFN TDLY TDEN TDOR TDRC TDRL TDTG TSSE TSOA TSOP TSOT TDAT TIME TORY TRDA TSIZ TYER TCMP TSO2 TSOC".split(" "),url:"WCOM WCOP WOAF WOAR WOAS WORS WPAY WPUB".split(" ")},frameTypes:{text:{encoding:1,value:"string"},url:{value:"latin1"},TXXX:{encoding:1,description:"string",value:"string"},WXXX:{encoding:1,description:"string",
|
|
value:"latin1"},USLT:{encoding:1,language:1,description:"string",value:"string"},COMM:{encoding:1,language:1,description:"string",value:"string"},APIC:{encoding:1,mime:"latin1",type:"int8",description:"string",data:"binary"},UFID:{owner:"latin1",identifier:"binary"},MCDI:{value:"binary"},PRIV:{owner:"latin1",value:"binary"},GEOB:{encoding:1,mime:"latin1",filename:"string",description:"string",data:"binary"},PCNT:{value:"int32+"},POPM:{email:"latin1",rating:"int8",counter:"int32+"},AENC:{owner:"latin1",
|
|
previewStart:"int16",previewLength:"int16",encryptionInfo:"binary"},ETCO:{format:"int8",data:"binary"},MLLT:{framesBetweenReference:"int16",bytesBetweenReference:"int24",millisecondsBetweenReference:"int24",bitsForBytesDeviation:"int8",bitsForMillisecondsDev:"int8",data:"binary"},SYTC:{format:"int8",tempoData:"binary"},SYLT:{encoding:1,language:1,format:"int8",contentType:"int8",description:"string",data:"binary"},RVA2:{identification:"latin1",data:"binary"},EQU2:{interpolationMethod:"int8",identification:"latin1",
|
|
data:"binary"},RVRB:{left:"int16",right:"int16",bouncesLeft:"int8",bouncesRight:"int8",feedbackLL:"int8",feedbackLR:"int8",feedbackRR:"int8",feedbackRL:"int8",premixLR:"int8",premixRL:"int8"},RBUF:{size:"int24",flag:"int8",offset:"int32"},LINK:{identifier:"frame_id",url:"latin1",data:"binary"},POSS:{format:"int8",position:"binary"},USER:{encoding:1,language:1,value:"string"},OWNE:{encoding:1,price:"latin1",purchaseDate:"date",seller:"string"},COMR:{encoding:1,price:"latin1",validUntil:"date",contactURL:"latin1",
|
|
receivedAs:"int8",seller:"string",description:"string",logoMime:"latin1",logo:"binary"},ENCR:{owner:"latin1",methodSymbol:"int8",data:"binary"},GRID:{owner:"latin1",groupSymbol:"int8",data:"binary"},SIGN:{groupSymbol:"int8",signature:"binary"},SEEK:{value:"int32"},ASPI:{dataStart:"int32",dataLength:"int32",numPoints:"int16",bitsPerPoint:"int8",data:"binary"},IPLS:{encoding:1,value:"string"},RVAD:{adjustment:"int8",bits:"int8",data:"binary"},EQUA:{adjustmentBits:"int8",data:"binary"}},names:{TIT1:"grouping",
|
|
TIT2:"title",TIT3:"subtitle",TALB:"album",TOAL:"originalAlbumTitle",TRCK:"trackNumber",TPOS:"diskNumber",TSST:"setSubtitle",TSRC:"ISRC",TPE1:"artist",TPE2:"albumArtist",TPE3:"conductor",TPE4:"modifiedBy",TOPE:"originalArtist",TEXT:"lyricist",TOLY:"originalLyricist",TCOM:"composer",TMCL:"musicianCreditsList",TIPL:"involvedPeopleList",TENC:"encodedBy",TBPM:"tempo",TLEN:"length",TKEY:"initialKey",TLAN:"language",TCON:"genre",TFLT:"fileType",TMED:"mediaType",TMOO:"mood",TCOP:"copyright",TPRO:"producedNotice",
|
|
TPUB:"publisher",TOWN:"fileOwner",TRSN:"internetRadioStationName",TRSO:"internetRadioStationOwner",TOFN:"originalFilename",TDLY:"playlistDelay",TDEN:"encodingTime",TDOR:"originalReleaseTime",TDRC:"recordingTime",TDRL:"releaseTime",TDTG:"taggingTime",TSSE:"encodedWith",TSOA:"albumSortOrder",TSOP:"performerSortOrder",TSOT:"titleSortOrder",TXXX:"userText",USLT:"lyrics",APIC:"coverArt",UFID:"uniqueIdentifier",MCDI:"CDIdentifier",COMM:"comments",WCOM:"commercialInformation",WCOP:"copyrightInformation",
|
|
WOAF:"officialAudioFileWebpage",WOAR:"officialArtistWebpage",WOAS:"officialAudioSourceWebpage",WORS:"officialInternetRadioStationHomepage",WPAY:"payment",WPUB:"officialPublisherWebpage",WXXX:"url",PRIV:"private",GEOB:"generalEncapsulatedObject",PCNT:"playCount",POPM:"rating",AENC:"audioEncryption",ETCO:"eventTimingCodes",MLLT:"MPEGLocationLookupTable",SYTC:"synchronisedTempoCodes",SYLT:"synchronisedLyrics",RVA2:"volumeAdjustment",EQU2:"equalization",RVRB:"reverb",RBUF:"recommendedBufferSize",LINK:"link",
|
|
POSS:"positionSynchronisation",USER:"termsOfUse",OWNE:"ownership",COMR:"commercial",ENCR:"encryption",GRID:"groupIdentifier",SIGN:"signature",SEEK:"seek",ASPI:"audioSeekPointIndex",TDAT:"date",TIME:"time",TORY:"originalReleaseYear",TRDA:"recordingDates",TSIZ:"size",TYER:"year",IPLS:"involvedPeopleList",RVAD:"volumeAdjustment",EQUA:"equalization",TCMP:"compilation",TSO2:"albumArtistSortOrder",TSOC:"composerSortOrder"}});m.ID3v22Stream=m.ID3v23Stream.extend({readHeader:function(){var b=this.stream.readString(3);
|
|
this.frameReplacements[b]&&!this.frameTypes[b]&&(this.frameTypes[b]=this.frameReplacements[b]);return{identifier:this.replacements[b]||b,length:this.stream.readUInt24()}},replacements:{UFI:"UFID",TT1:"TIT1",TT2:"TIT2",TT3:"TIT3",TP1:"TPE1",TP2:"TPE2",TP3:"TPE3",TP4:"TPE4",TCM:"TCOM",TXT:"TEXT",TLA:"TLAN",TCO:"TCON",TAL:"TALB",TPA:"TPOS",TRK:"TRCK",TRC:"TSRC",TYE:"TYER",TDA:"TDAT",TIM:"TIME",TRD:"TRDA",TMT:"TMED",TFT:"TFLT",TBP:"TBPM",TCR:"TCOP",TPB:"TPUB",TEN:"TENC",TSS:"TSSE",TOF:"TOFN",TLE:"TLEN",
|
|
TSI:"TSIZ",TDY:"TDLY",TKE:"TKEY",TOT:"TOAL",TOA:"TOPE",TOL:"TOLY",TOR:"TORY",TXX:"TXXX",WAF:"WOAF",WAR:"WOAR",WAS:"WOAS",WCM:"WCOM",WCP:"WCOP",WPB:"WPUB",WXX:"WXXX",IPL:"IPLS",MCI:"MCDI",ETC:"ETCO",MLL:"MLLT",STC:"SYTC",ULT:"USLT",SLT:"SYLT",COM:"COMM",RVA:"RVAD",EQU:"EQUA",REV:"RVRB",GEO:"GEOB",CNT:"PCNT",POP:"POPM",BUF:"RBUF",CRA:"AENC",LNK:"LINK",TST:"TSOT",TSP:"TSOP",TSA:"TSOA",TCP:"TCMP",TS2:"TSO2",TSC:"TSOC"},frameReplacements:{PIC:{encoding:1,format:"int24",type:"int8",description:"string",
|
|
data:"binary"},CRM:{owner:"latin1",description:"latin1",data:"binary"}}})},{}],8:[function(r,b,m){function g(){this.tmp_imdct36=new Float64Array(18);this.tmp_dctIV=new Float64Array(18);this.tmp_sdctII=new Float64Array(9)}function l(a,b,e){var A,l,n,g,p,m,B,r,D,C,y,E;A=a[3]+a[5];l=a[3]-a[5];n=a[6]+a[2];g=a[6]-a[2];p=a[1]+a[7];m=a[1]-a[7];B=a[8]+a[0];r=a[8]-a[0];D=A+n+B;C=(l+g)*-c;y=(l-r)*-d;E=(g+r)*-x;l=(l-g+r)*-q;m*=-q;g=(n-B)*-w;B=(A-B)*-k;n=(A-n)*-h;A=a[4]+p;a=2*a[4]-p;b[e+0]=A+D;b[e+2]=C-(m+y);
|
|
b[e+4]=n-(a+g);b[e+6]=l;b[e+8]=a-g-B;b[e+10]=m-E-y;b[e+12]=D-2*A;b[e+14]=m+E+C;b[e+16]=a+B+n}g.prototype.imdct36=function(a,b){var k=this.tmp_imdct36;this.dctIV(a,k);for(var c=0;9>c;++c)b[c]=k[9+c];for(c=9;27>c;++c)b[c]=-k[36-(9+c)-1];for(c=27;36>c;++c)b[c]=-k[c-27]};var a=[];for(r=0;18>r;r++)a[r]=2*Math.cos(Math.PI*(2*r+1)/72);g.prototype.dctIV=function(b,k){for(var c=this.tmp_dctIV,d=0;18>d;++d)c[d]=b[d]*a[d];this.sdctII(c,k);k[0]/=2;for(d=1;18>d;++d)k[d]=k[d]/2-k[d-1]};var e=[];for(r=0;9>r;++r)e[r]=
|
|
2*Math.cos(Math.PI*(2*r+1)/36);g.prototype.sdctII=function(a,b){for(var k=this.tmp_sdctII,c=0;9>c;++c)k[c]=a[c]+a[18-c-1];l(k,b,0);for(c=0;9>c;++c)k[c]=(a[c]-a[18-c-1])*e[c];l(k,b,1);for(c=3;18>c;c+=2)b[c]-=b[c-2]};var d=2*Math.cos(1*Math.PI/18),q=2*Math.cos(3*Math.PI/18),h=2*Math.cos(4*Math.PI/18),c=2*Math.cos(5*Math.PI/18),x=2*Math.cos(7*Math.PI/18),k=2*Math.cos(8*Math.PI/18),w=2*Math.cos(16*Math.PI/18);g.S=[[.608761429,-.923879533,-.130526192,.991444861,-.382683432,-.79335334],[-.79335334,.382683432,
|
|
.991444861,.130526192,-.923879533,-.608761429],[.382683432,-.923879533,.923879533,-.382683432,-.382683432,.923879533],[-.923879533,-.382683432,.382683432,.923879533,.923879533,.382683432],[.130526192,-.382683432,.608761429,-.79335334,.923879533,-.991444861],[-.991444861,-.923879533,-.79335334,-.608761429,-.382683432,-.130526192]];b.exports=g},{}],9:[function(r,b,m){function g(){this.allocation=e.makeArray([2,32],Uint8Array);this.scalefactor=e.makeArray([2,32],Uint8Array)}var l=r("./tables"),a=r("./header");
|
|
m=r("./frame");var e=r("./utils");m.layers[1]=g;var d=new Float32Array([1.33333333333333,1.14285714285714,1.06666666666667,1.03225806451613,1.01587301587302,1.00787401574803,1.00392156862745,1.00195694716243,1.00097751710655,1.00048851978505,1.0002442002442,1.00012208521548,1.00006103888177,1.00003051850948]);g.prototype.decode=function(b,d){var c=d.header,e=c.nchannels(),k=32;c.mode===a.MODE.JOINT_STEREO&&(c.flags|=a.FLAGS.I_STEREO,k=4+4*c.mode_extension);for(var c=this.allocation,w=0;w<k;w++)for(var t=
|
|
0;t<e;t++){var u=b.read(4);if(15===u)throw Error("forbidden bit allocation value");c[t][w]=u?u+1:0}for(w=k;32>w;w++){u=b.read(4);if(15===u)throw Error("forbidden bit allocation value");c[0][w]=c[1][w]=u?u+1:0}for(var g=this.scalefactor,w=0;32>w;w++)for(t=0;t<e;t++)c[t][w]&&(g[t][w]=b.read(6));for(var A=0;12>A;A++){for(w=0;w<k;w++)for(t=0;t<e;t++)u=c[t][w],d.sbsample[t][A][w]=u?this.sample(b,u)*l.SF_TABLE[g[t][w]]:0;for(w=k;32>w;w++)if(u=c[0][w])for(u=this.sample(b,u),t=0;t<e;t++)d.sbsample[t][A][w]=
|
|
u*l.SF_TABLE[g[t][w]];else for(t=0;t<e;t++)d.sbsample[t][A][w]=0}};g.prototype.sample=function(a,b){var c=a.read(b),c=c^1<<b-1,c=(c|-(c&1<<b-1))/(1<<b-1),c=c+(1>>b-1);return c*d[b-2]};b.exports=g},{"./frame":4,"./header":5,"./tables":14,"./utils":15}],10:[function(r,b,m){function g(){this.samples=new Float64Array(3);this.allocation=e.makeArray([2,32],Uint8Array);this.scfsi=e.makeArray([2,32],Uint8Array);this.scalefactor=e.makeArray([2,32,3],Uint8Array)}var l=r("./tables"),a=r("./header");m=r("./frame");
|
|
var e=r("./utils");m.layers[2]=g;var d=[{sblimit:27,offsets:[7,7,7,6,6,6,6,6,6,6,6,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0]},{sblimit:30,offsets:[7,7,7,6,6,6,6,6,6,6,6,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0]},{sblimit:8,offsets:[5,5,2,2,2,2,2,2]},{sblimit:12,offsets:[5,5,2,2,2,2,2,2,2,2,2,2]},{sblimit:30,offsets:[4,4,4,4,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}],q=[{nbal:2,offset:0},{nbal:2,offset:3},{nbal:3,offset:3},{nbal:3,offset:1},{nbal:4,offset:2},{nbal:4,offset:3},{nbal:4,offset:4},{nbal:4,
|
|
offset:5}],h=[[0,1,16],[0,1,2,3,4,5,16],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,16],[0,2,4,5,6,7,8,9,10,11,12,13,14,15,16]],c=[{nlevels:3,group:2,bits:5,C:1.33333333333,D:.5},{nlevels:5,group:3,bits:7,C:1.6,D:.5},{nlevels:7,group:0,bits:3,C:1.14285714286,D:.25},{nlevels:9,group:4,bits:10,C:1.77777777777,D:.5},{nlevels:15,group:0,bits:4,C:1.06666666666,D:.125},{nlevels:31,group:0,bits:5,C:1.03225806452,D:.0625},{nlevels:63,group:0,
|
|
bits:6,C:1.01587301587,D:.03125},{nlevels:127,group:0,bits:7,C:1.00787401575,D:.015625},{nlevels:255,group:0,bits:8,C:1.00392156863,D:.0078125},{nlevels:511,group:0,bits:9,C:1.00195694716,D:.00390625},{nlevels:1023,group:0,bits:10,C:1.00097751711,D:.001953125},{nlevels:2047,group:0,bits:11,C:1.00048851979,D:9.765625E-4},{nlevels:4095,group:0,bits:12,C:1.00024420024,D:4.8828125E-4},{nlevels:8191,group:0,bits:13,C:1.00012208522,D:2.4414063E-4},{nlevels:16383,group:0,bits:14,C:1.00006103888,D:1.2207031E-4},
|
|
{nlevels:32767,group:0,bits:15,C:1.00003051851,D:6.103516E-5},{nlevels:65535,group:0,bits:16,C:1.00001525902,D:3.051758E-5}];g.prototype.decode=function(b,k){var e=k.header,t=e.nchannels(),u;if(e.flags&a.FLAGS.LSF_EXT)u=4;else if(e.flags&a.FLAGS.FREEFORMAT)u=48E3===e.samplerate?0:1;else{var g=e.bitrate;if(2===t)g/=2;else if(192E3<g)throw Error("bad bitrate/mode combination");u=48E3>=g?32E3===e.samplerate?3:2:8E4>=g?0:48E3===e.samplerate?0:1}var g=d[u].sblimit,A=d[u].offsets,m=32;e.mode===a.MODE.JOINT_STEREO&&
|
|
(e.flags|=a.FLAGS.I_STEREO,m=4+4*e.mode_extension);m>g&&(m=g);for(var e=this.allocation,n=0;n<m;n++)for(var v=q[A[n]].nbal,p=0;p<t;p++)e[p][n]=b.read(v);for(n=m;n<g;n++)v=q[A[n]].nbal,e[0][n]=e[1][n]=b.read(v);for(var r=this.scfsi,n=0;n<g;n++)for(p=0;p<t;p++)e[p][n]&&(r[p][n]=b.read(2));v=this.scalefactor;for(n=0;n<g;n++)for(p=0;p<t;p++)if(e[p][n]){v[p][n][0]=b.read(6);switch(r[p][n]){case 2:v[p][n][2]=v[p][n][1]=v[p][n][0];break;case 0:v[p][n][1]=b.read(6);case 1:case 3:v[p][n][2]=b.read(6)}r[p][n]&
|
|
1&&(v[p][n][1]=v[p][n][r[p][n]-1])}for(r=0;12>r;r++){for(n=0;n<m;n++)for(p=0;p<t;p++)if(u=e[p][n]){u=h[q[A[n]].offset][u-1];this.decodeSamples(b,c[u]);u=l.SF_TABLE[v[p][n][r>>2]];for(var B=0;3>B;B++)k.sbsample[p][3*r+B][n]=this.samples[B]*u}else for(B=0;3>B;B++)k.sbsample[p][3*r+B][n]=0;for(n=m;n<g;n++)if(u=e[0][n])for(u=h[q[A[n]].offset][u-1],this.decodeSamples(b,c[u]),p=0;p<t;p++)for(u=l.SF_TABLE[v[p][n][r>>2]],B=0;3>B;B++)k.sbsample[p][3*r+B][n]=this.samples[B]*u;else for(p=0;p<t;p++)for(B=0;3>
|
|
B;B++)k.sbsample[p][3*r+B][n]=0;for(p=0;p<t;p++)for(B=0;3>B;B++)for(n=g;32>n;n++)k.sbsample[p][3*r+B][n]=0}};g.prototype.decodeSamples=function(a,b){var c=this.samples,d=b.group;if(d)for(var e=a.read(b.bits),h=b.nlevels,g=0;3>g;g++)c[g]=e%h,e=e/h|0;else for(d=b.bits,g=0;3>g;g++)c[g]=a.read(d);for(g=0;3>g;g++)e=c[g]^1<<d-1,e|=-(e&1<<d-1),e/=1<<d-1,c[g]=(e+b.D)*b.C};b.exports=g},{"./frame":4,"./header":5,"./tables":14,"./utils":15}],11:[function(r,b,m){function g(){this.private_bits=this.main_data_begin=
|
|
null;this.gr=[new l,new l];this.scfsi=new Uint8Array(2)}function l(){this.ch=[new a,new a]}function a(){this.block_type=this.flags=this.scalefac_compress=this.global_gain=this.big_values=this.part2_3_length=null;this.table_select=new Uint8Array(3);this.subblock_gain=new Uint8Array(3);this.region1_count=this.region0_count=null;this.scalefac=new Uint8Array(39)}function e(){this.imdct=new c;this.si=new g;this.xr=[new Float64Array(576),new Float64Array(576)];this._exponents=new Int32Array(39);this.reqcache=
|
|
new Float64Array(16);this.modes=new Int16Array(39);this.output=new Float64Array(36);this.tmp=x.makeArray([32,3,6]);this.tmp2=new Float64Array(576)}var d=r("./tables"),q=r("./header");m=r("./frame");var h=r("./huffman"),c=r("./imdct"),x=r("./utils");m.layers[3]=e;e.prototype.decode=function(a,b){var c=b.header,d=0,e=0,h=c.nchannels(),g=c.flags&q.FLAGS.LSF_EXT?1===h?9:17:1===h?17:32;if(a.next_frame-a.nextByte()<g)throw a.md_len=0,Error("Bad frame length");e=this.sideInfo(a,h,c.flags&q.FLAGS.LSF_EXT);
|
|
g=e.si;c.flags|=e.priv_bitlen;c.private_bits|=g.private_bits;e=a.copy();e.seek(8*a.next_frame);c=e.read(16);65506===(c&65510)&&(0===(c&1)&&e.advance(16),e.advance(16),d=e.read(c&8?9:8));var n=a.next_frame-a.nextByte();d>g.main_data_begin+n&&(d=0);var e=g.main_data_begin+n-d,l=0;if(0===g.main_data_begin)c=a.stream,a.md_len=0,l=e;else{if(g.main_data_begin>a.md_len)throw Error("bad main_data_begin pointer");var p=a.md_len;if(e>g.main_data_begin){if(a.md_len+e-g.main_data_begin>q.BUFFER_MDLEN)throw Error("Assertion failed: (stream.md_len + md_len - si.main_data_begin <= MAD_MP3FrameHeader.BUFFER_MDLEN)");
|
|
l=e-g.main_data_begin;this.memcpy(a.main_data,a.md_len,a.stream.stream,a.nextByte(),l);a.md_len+=l}c=new AV.Bitstream(AV.Stream.fromBuffer(new AV.Buffer(a.main_data)));c.advance(8*(p-g.main_data_begin))}n-=l;this.decodeMainData(c,b,g,h);n>=d?(this.memcpy(a.main_data,0,a.stream.stream,a.next_frame-d,d),a.md_len=d):(e<g.main_data_begin?(h=g.main_data_begin-e,h+n>d&&(h=d-n),h<a.md_len&&(this.memcpy(a.main_data,0,a.main_data,a.md_len-h,h),a.md_len=h)):a.md_len=0,this.memcpy(a.main_data,a.md_len,a.stream.stream,
|
|
a.next_frame-n,n),a.md_len+=n)};e.prototype.memcpy=function(a,b,c,d,e){c=c.subarray?c.subarray(d,d+e):c.peekBuffer(d-c.offset,e).data;a.set(c,b);return a};e.prototype.sideInfo=function(a,b,c){var e=this.si,h=0,g=c?1===b?1:2:1===b?5:3;e.main_data_begin=a.read(c?8:9);e.private_bits=a.read(g);var l=1;if(!c)for(var l=2,n=0;n<b;++n)e.scfsi[n]=a.read(4);for(var v=0;v<l;v++)for(var p=e.gr[v],n=0;n<b;n++){var q=p.ch[n];q.part2_3_length=a.read(12);q.big_values=a.read(9);q.global_gain=a.read(8);q.scalefac_compress=
|
|
a.read(c?9:4);h+=q.part2_3_length;if(288<q.big_values)throw Error("bad big_values count");q.flags=0;if(a.read(1)){q.block_type=a.read(2);if(0===q.block_type)throw Error("reserved block_type");if(!c&&2===q.block_type&&e.scfsi[n])throw Error("bad scalefactor selection info");q.region0_count=7;q.region1_count=36;a.read(1)?q.flags|=d.MIXED_BLOCK_FLAG:2===q.block_type&&(q.region0_count=8);for(var m=0;2>m;m++)q.table_select[m]=a.read(5);for(m=0;3>m;m++)q.subblock_gain[m]=a.read(3)}else{for(m=q.block_type=
|
|
0;3>m;m++)q.table_select[m]=a.read(5);q.region0_count=a.read(4);q.region1_count=a.read(3)}q.flags|=a.read(c?2:3)}return{si:e,data_bitlen:h,priv_bitlen:g}};e.prototype.decodeMainData=function(a,b,c,e){var h=b.header,g=h.samplerate;h.flags&q.FLAGS.MPEG_2_5_EXT&&(g*=2);g=(g>>7&15)+(g>>15&1)-8;h.flags&q.FLAGS.MPEG_2_5_EXT&&(g+=3);for(var l=h.flags&q.FLAGS.LSF_EXT?1:2,n=this.xr,v=0;v<l;++v){for(var p=c.gr[v],m=[],x=0,r=0;r<e;++r){var D=p.ch[r];m[r]=d.SFBWIDTH_TABLE[g].l;2===D.block_type&&(m[r]=D.flags&
|
|
d.MIXED_BLOCK_FLAG?d.SFBWIDTH_TABLE[g].m:d.SFBWIDTH_TABLE[g].s);x=h.flags&q.FLAGS.LSF_EXT?this.scalefactors_lsf(a,D,0===r?0:c.gr[1].ch[1],h.mode_extension):this.scalefactors(a,D,c.gr[0].ch[r],0===v?0:c.scfsi[r]);this.huffmanDecode(a,n[r],D,m[r],x)}h.mode===q.MODE.JOINT_STEREO&&0!==h.mode_extension&&this.stereo(n,c.gr,v,h,m[0]);for(r=0;r<e;r++){var D=p.ch[r],C=b.sbsample[r].slice(18*v),y,x=0,E,I=this.output;2===D.block_type?(this.reorder(n[r],D,m[r]),D.flags&d.MIXED_BLOCK_FLAG&&this.aliasreduce(n[r],
|
|
36)):this.aliasreduce(n[r],576);if(2!==D.block_type||D.flags&d.MIXED_BLOCK_FLAG)for(E=D.block_type,D.flags&d.MIXED_BLOCK_FLAG&&(E=0),y=0;2>y;++y,x+=18)this.imdct_l(n[r].subarray(x,x+18),I,E),this.overlap(I,b.overlap[r][y],C,y);else for(y=0;2>y;++y,x+=18)this.imdct_s(n[r].subarray(x,x+18),I),this.overlap(I,b.overlap[r][y],C,y);this.freqinver(C,1);for(y=576;36<y&&0===n[r][y-1];)--y;E=32-((576-y)/18<<0);if(2!==D.block_type)for(y=2;y<E;++y,x+=18)this.imdct_l(n[r].subarray(x,x+18),I,D.block_type),this.overlap(I,
|
|
b.overlap[r][y],C,y),y&1&&this.freqinver(C,y);else for(y=2;y<E;++y,x+=18)this.imdct_s(n[r].subarray(x,x+18),I),this.overlap(I,b.overlap[r][y],C,y),y&1&&this.freqinver(C,y);for(y=E;32>y;++y)this.overlap_z(b.overlap[r][y],C,y),y&1&&this.freqinver(C,y)}}};e.prototype.scalefactors=function(a,b,c,e){var h=a.offset(),g=d.SFLEN_TABLE[b.scalefac_compress].slen1,l=d.SFLEN_TABLE[b.scalefac_compress].slen2,n;if(2===b.block_type){n=0;for(c=b.flags&d.MIXED_BLOCK_FLAG?17:18;c--;)b.scalefac[n++]=a.read(g);for(c=
|
|
18;c--;)b.scalefac[n++]=a.read(l);for(c=3;c--;)b.scalefac[n++]=0}else{if(e&8)for(n=0;6>n;++n)b.scalefac[n]=c.scalefac[n];else for(n=0;6>n;++n)b.scalefac[n]=a.read(g);if(e&4)for(n=6;11>n;++n)b.scalefac[n]=c.scalefac[n];else for(n=6;11>n;++n)b.scalefac[n]=a.read(g);if(e&2)for(n=11;16>n;++n)b.scalefac[n]=c.scalefac[n];else for(n=11;16>n;++n)b.scalefac[n]=a.read(l);if(e&1)for(n=16;21>n;++n)b.scalefac[n]=c.scalefac[n];else for(n=16;21>n;++n)b.scalefac[n]=a.read(l);b.scalefac[21]=0}return a.offset()-h};
|
|
e.prototype.scalefactors_lsf=function(a,b,c,e){var h=a.offset(),g=b.scalefac_compress,l=2===b.block_type?b.flags&d.MIXED_BLOCK_FLAG?2:1:0,n=new Int32Array(4);if(e&d.I_STEREO&&c){g>>>=1;180>g?(n[0]=g/36,n[1]=g%36/6,n[2]=g%36%6,n[3]=0,e=d.NSFB_TABLE[3][l]):244>g?(g-=180,n[0]=g%64>>>4,n[1]=g%16>>>2,n[2]=g%4,n[3]=0,e=d.NSFB_TABLE[4][l]):(g-=244,n[0]=g/3,n[1]=g%3,n[2]=0,n[3]=0,e=d.NSFB_TABLE[5][l]);for(p=q=0;4>p;++p)for(g=(1<<n[p])-1,m=0;m<e[p];++m)l=a.read(n[p]),b.scalefac[q]=l,c.scalefac[q++]=l===g?
|
|
1:0;for(;39>q;)b.scalefac[q]=0,c.scalefac[q++]=0}else{400>g?(n[0]=(g>>>4)/5,n[1]=(g>>>4)%5,n[2]=g%16>>>2,n[3]=g%4,e=d.NSFB_TABLE[0][l]):500>g?(g-=400,n[0]=(g>>>2)/5,n[1]=(g>>>2)%5,n[2]=g%4,n[3]=0,e=d.NSFB_TABLE[1][l]):(g-=500,n[0]=g/3,n[1]=g%3,n[2]=0,n[3]=0,b.flags|=d.PREFLAG,e=d.NSFB_TABLE[2][l]);for(var q=0,p=0;4>p;p++)for(var m=0;m<e[p];m++)b.scalefac[q++]=a.read(n[p]);for(;39>q;)b.scalefac[q++]=0}return a.offset()-h};e.prototype.huffmanDecode=function(a,b,c,e,g){var l=this._exponents,m=0;g=c.part2_3_length-
|
|
g;if(0>g)throw Error("bad audio data length");this.exponents(c,e,l);var n=a.copy();a.advance(g);a=8-n.bitPosition;a+=7+(24-a)&-8;var v=n.read(a);g-=a;var p=0,x=0,r=this.reqcache,G=p+e[m++],D=c.region0_count+1,C=h.huff_pair_table[c.table_select[x]],y=C.table,E=C.linbits,C=C.startbits;if("undefined"===typeof y)throw Error("bad Huffman table select");for(var I=0,K=l[I++],L=0,P=c.big_values;P--&&0<a+g;){if(p===G){G+=e[m++];if(0===--D&&(D=0===x?c.region1_count+1:0,C=h.huff_pair_table[c.table_select[++x]],
|
|
y=C.table,E=C.linbits,C=C.startbits,"undefined"===typeof y))throw Error("bad Huffman table select");K!==l[I]&&(K=l[I],L=0);++I}if(21>a){var J=10+(21-a)&-8,v=v<<J|n.read(J);a+=J;g-=J}for(var z=C,J=y[v>>a-z&(1<<z)-1];!J["final"];)a-=z,z=J.ptr.bits,J=y[J.ptr.offset+(v>>a-z&(1<<z)-1)];a-=J.value.hlen;if(E){var z=J.value.x,N=!1;switch(z){case 0:b[p]=0;break;case 15:a<E+2&&(v=v<<16|n.read(16),a+=16,g-=16);z+=v>>a-E&(1<<E)-1;a-=E;F=this.requantize(z,K);N=!0;break;default:L&1<<z?F=r[z]:(L|=1<<z,F=r[z]=this.requantize(z,
|
|
K)),N=!0}N&&(b[p]=v&1<<a-- -1?-F:F);z=J.value.y;J=!1;switch(z){case 0:b[p+1]=0;break;case 15:a<E+1&&(v=v<<16|n.read(16),a+=16,g-=16);z+=v>>a-E&(1<<E)-1;a-=E;F=this.requantize(z,K);J=!0;break;default:L&1<<z||(L|=1<<z,r[z]=this.requantize(z,K)),F=r[z],J=!0}J&&(b[p+1]=v&1<<a-- -1?-F:F)}else z=J.value.x,0===z?b[p]=0:(L&1<<z?F=r[z]:(L|=1<<z,F=r[z]=this.requantize(z,K)),b[p]=v&1<<a-- -1?-F:F),z=J.value.y,0===z?b[p+1]=0:(L&1<<z?F=r[z]:(L|=1<<z,F=r[z]=this.requantize(z,K)),b[p+1]=v&1<<a-- -1?-F:F);p+=2}if(0>
|
|
a+g)throw Error("Huffman data overrun");for(var y=h.huff_quad_table[c.flags&d.COUNT1TABLE_SELECT],F=this.requantize(1,K);0<a+g&&572>=p;)10>a&&(v=v<<16|n.read(16),a+=16,g-=16),c=y[v>>a-4&15],c["final"]||(a-=4,c=y[c.ptr.offset+(v>>a-c.ptr.bits&(1<<c.ptr.bits)-1)]),a-=c.value.hlen,p===G&&(G+=e[m++],K!==l[I]&&(K=l[I],F=this.requantize(1,K)),++I),b[p]=c.value.v?v&1<<a-- -1?-F:F:0,b[p+1]=c.value.w?v&1<<a-- -1?-F:F:0,p+=2,p===G&&(G+=e[m++],K!==l[I]&&(K=l[I],F=this.requantize(1,K)),++I),b[p]=c.value.x?v&
|
|
1<<a-- -1?-F:F:0,b[p+1]=c.value.y?v&1<<a-- -1?-F:F:0,p+=2,0>a+g&&(p-=4);if(-g>8*q.BUFFER_GUARD)throw Error("assertion failed: (-bits_left <= MP3FrameHeader.BUFFER_GUARD * CHAR_BIT)");for(;576>p;)b[p]=0,b[p+1]=0,p+=2};e.prototype.requantize=function(a,b){var c=b%4>>0;b=b/4>>0;var d=Math.pow(a,4/3),d=d*Math.pow(2,b/4);c&&(d*=Math.pow(2,c/4));0>b&&(d/=Math.pow(2,.75*-b));return d};e.prototype.exponents=function(a,b,c){var e=a.global_gain-210,h=a.flags&d.SCALEFAC_SCALE?2:1;if(2===a.block_type){var g=
|
|
0,l=0;if(a.flags&d.MIXED_BLOCK_FLAG)for(var n=a.flags&d.PREFLAG?-1:0;36>l;)c[g]=e-(a.scalefac[g]+(d.PRETAB[g]&n)<<h),l+=b[g++];for(var n=e-8*a.subblock_gain[0],q=e-8*a.subblock_gain[1],e=e-8*a.subblock_gain[2];576>l;)c[g+0]=n-(a.scalefac[g+0]<<h),c[g+1]=q-(a.scalefac[g+1]<<h),c[g+2]=e-(a.scalefac[g+2]<<h),l+=3*b[g],g+=3}else if(a.flags&d.PREFLAG)for(g=0;22>g;g++)c[g]=e-(a.scalefac[g]+d.PRETAB[g]<<h);else for(g=0;22>g;g++)c[g]=e-(a.scalefac[g]<<h)};e.prototype.stereo=function(a,b,c,e,h){var g=b[c],
|
|
l=this.modes,n,m,p;if(g.ch[0].block_type!==g.ch[1].block_type||(g.ch[0].flags&d.MIXED_BLOCK_FLAG)!==(g.ch[1].flags&d.MIXED_BLOCK_FLAG))throw Error("incompatible stereo block_type");for(p=0;39>p;p++)l[p]=e.mode_extension;if(e.mode_extension&d.I_STEREO){var x=g.ch[1],r=a[1];e.flags|=q.FLAGS.tables.I_STEREO;if(2===x.block_type){var G,D,C,y=new Uint32Array(3),E,g=n=G=D=C=y[0]=y[1]=y[2]=0;if(x.flags&d.MIXED_BLOCK_FLAG){for(;36>n;){m=h[g++];for(p=0;p<m;++p)if(r[p]){G=g;break}r+=m;n+=m}D=g}for(E=0;576>n;){m=
|
|
h[g++];for(p=0;p<m;++p)if(r[p]){C=y[E]=g;break}r+=m;n+=m;E=(E+1)%3}C&&(G=D);for(p=0;p<G;++p)l[p]=e.mode_extension&~d.I_STEREO;E=0;for(p=D;p<C;++p)p<y[E]&&(l[p]=e.mode_extension&~d.I_STEREO),E=(E+1)%3}else{for(g=n=y=0;576>n;n+=m){m=h[g++];for(p=0;p<m;++p)if(r[p]){y=g;break}r+=m}for(p=0;p<y;++p)l[p]=e.mode_extension&~d.I_STEREO}if(e.flags&q.FLAGS.LSF_EXT)for(b=b[c+1].ch[1].scalefac,c=IS_Ltables.SF_TABLE[x.scalefac_compress&1],g=n=0;576>n;++g,n+=m){if(m=h[g],l[g]&d.I_STEREO)if(b[g])l[g]&=~d.I_STEREO;
|
|
else for(is_pos=x.scalefac[g],p=0;p<m;++p)r=a[0][n+p],0===is_pos?a[1][n+p]=r:(G=r*c[(is_pos-1)/2],is_pos&1?(a[0][n+p]=G,a[1][n+p]=r):a[1][n+p]=G)}else for(g=n=0;576>n;++g,n+=m)if(m=h[g],l[g]&d.I_STEREO)if(is_pos=x.scalefac[g],7<=is_pos)l[g]&=~d.I_STEREO;else for(p=0;p<m;++p)r=a[0][n+p],a[0][n+p]=r*d.IS_TABLE[is_pos],a[1][n+p]=r*d.IS_TABLE[6-is_pos]}if(e.mode_extension&d.MS_STEREO)for(e.flags|=d.MS_STEREO,e=d.ROOT_TABLE[1],g=n=0;576>n;++g,n+=m)if(m=h[g],l[g]===d.MS_STEREO)for(p=0;p<m;++p)x=a[0][n+
|
|
p],b=a[1][n+p],a[0][n+p]=(x+b)*e,a[1][n+p]=(x-b)*e};e.prototype.aliasreduce=function(a,b){for(var c=18;c<b;c+=18)for(var e=0;8>e;++e){var g=a[c-e-1],h=a[c+e];a[c-e-1]=g*d.CS[e]-h*d.CA[e];a[c+e]=h*d.CS[e]+g*d.CA[e]}};e.prototype.imdct_l=function(a,b,c){this.imdct.imdct36(a,b);switch(c){case 0:for(a=0;36>a;++a)b[a]*=d.WINDOW_L[a];break;case 1:for(a=0;18>a;++a)b[a]*=d.WINDOW_L[a];for(a=24;30>a;++a)b[a]*=d.WINDOW_S[a-18];for(a=30;36>a;++a)b[a]=0;break;case 3:for(a=0;6>a;++a)b[a]=0;for(a=6;12>a;++a)b[a]*=
|
|
d.WINDOW_S[a-6];for(a=18;36>a;++a)b[a]*=d.WINDOW_L[a]}};e.prototype.imdct_s=function(a,b){var e=0,g;g=0;for(var h=new Float64Array(36),l,q=0;3>q;++q){for(var n=0,m=0;3>m;++m)l=a[g+0]*c.S[n][0]+a[g+1]*c.S[n][1]+a[g+2]*c.S[n][2]+a[g+3]*c.S[n][3]+a[g+4]*c.S[n][4]+a[g+5]*c.S[n][5],h[e+m+0]=l,h[e+5-m]=-h[e+m+0],++n,l=a[g+0]*c.S[n][0]+a[g+1]*c.S[n][1]+a[g+2]*c.S[n][2]+a[g+3]*c.S[n][3]+a[g+4]*c.S[n][4]+a[g+5]*c.S[n][5],h[e+m+6]=l,h[e+11-m]=h[e+m+6],++n;e+=12;g+=6}for(m=g=e=0;6>m;++m)b[m+0]=0,b[m+6]=h[e+
|
|
0+0]*d.WINDOW_S[g+0],l=h[e+0+6]*d.WINDOW_S[g+6]+h[e+12+0]*d.WINDOW_S[g+0],b[m+12]=l,l=h[e+12+6]*d.WINDOW_S[g+6]+h[e+24+0]*d.WINDOW_S[g+0],b[m+18]=l,b[m+24]=h[e+24+6]*d.WINDOW_S[g+6],b[m+30]=0,++e,++g};e.prototype.overlap=function(a,b,c,d){for(var e=0;18>e;++e)c[e][d]=a[e]+b[e],b[e]=a[e+18]};e.prototype.freqinver=function(a,b){for(var c=1;18>c;c+=2)a[c][b]=-a[c][b]};e.prototype.overlap_z=function(a,b,c){for(var d=0;18>d;++d)b[d][c]=a[d],a[d]=0};e.prototype.reorder=function(a,b,c){var e=0,g=this.tmp,
|
|
h=new Uint32Array(3),l=new Uint32Array(3),n=0;if(b.flags&d.MIXED_BLOCK_FLAG)for(n=2,b=0;36>b;)b+=c[e++];for(var m=0;3>m;++m)h[m]=n,l[m]=0;f=c[e++];m=0;for(b=18*n;576>b;++b)0===f--&&(f=c[e++]-1,m=(m+1)%3),g[h[m]][m][l[m]++]=a[b],6===l[m]&&(l[m]=0,++h[m]);c=this.tmp2;for(e=h=0;32>e;e++)for(l=0;3>l;l++)for(b=0;6>b;b++)c[h++]=g[e][l][b];g=576-18*n;for(e=0;e<g;e++)a[18*n+e]=c[n+e]};b.exports=e},{"./frame":4,"./header":5,"./huffman":6,"./imdct":8,"./tables":14,"./utils":15}],12:[function(r,b,m){function g(a){this.stream=
|
|
a;this.sync=!1;this.freerate=0;this.next_frame=this.this_frame=a.stream.offset;this.main_data=new Uint8Array(l.BUFFER_MDLEN);this.md_len=0;for(var b in a)"function"===typeof a[b]&&(this[b]=a[b].bind(a))}var l=r("./header");g.prototype.getU8=function(a){var b=this.stream.stream;return b.peekUInt8(a-b.offset)};g.prototype.nextByte=function(){var a=this.stream;return 0===a.bitPosition?a.stream.offset:a.stream.offset+1};g.prototype.doSync=function(){var a=this.stream.stream;for(this.align();this.available(16)&&
|
|
(255!==a.peekUInt8(0)||224!==(a.peekUInt8(1)&224));)this.advance(8);return this.available(l.BUFFER_GUARD)?!0:!1};g.prototype.reset=function(a){this.seek(8*a);this.next_frame=a;this.sync=!0};b.exports=g},{"./header":5}],13:[function(r,b,m){function g(){this.filter=l.makeArray([2,2,2,16,8]);this.phase=0;this.pcm={samplerate:0,channels:0,length:0,samples:[new Float64Array(1152),new Float64Array(1152)]}}var l=r("./utils");g.dct32=function(a,b,g,h){var c,l,k,m,t,r,H,A,M,n,v,p,O,B,G,D,C,y,E,I,K,L,P,J,z,
|
|
N,F,Q,R,S,T,U,V,W,X,Y,Z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,Sa,Ta,Ua,Va,Wa,Xa,Ya,Za,$a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb,Mb,Nb,Ob,Pb,Qb,Rb,Sb,Tb,Ub,Vb,Wb,Xb,Yb,Zb,$b,ac,bc,cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc;c=a[0]+a[31];C=.998795456*(a[0]-a[31]);l=a[15]+a[16];y=.049067674*
|
|
(a[15]-a[16]);ea=C+y;wa=.995184727*(C-y);W=c+l;na=.995184727*(c-l);k=a[7]+a[24];E=.740951125*(a[7]-a[24]);m=a[8]+a[23];I=.671558955*(a[8]-a[23]);fa=E+I;xa=.09801714*(E-I);X=k+m;oa=.09801714*(k-m);t=a[3]+a[28];K=.941544065*(a[3]-a[28]);r=a[12]+a[19];L=.336889853*(a[12]-a[19]);ga=K+L;ya=.773010453*(K-L);Y=t+r;pa=.773010453*(t-r);H=a[4]+a[27];P=.903989293*(a[4]-a[27]);A=a[11]+a[20];J=.427555093*(a[11]-a[20]);ha=P+J;za=.634393284*(P-J);Z=H+A;qa=.634393284*(H-A);M=a[1]+a[30];z=.98917651*(a[1]-a[30]);n=
|
|
a[14]+a[17];N=.146730474*(a[14]-a[17]);ia=z+N;Aa=.956940336*(z-N);aa=M+n;ra=.956940336*(M-n);v=a[6]+a[25];F=.803207531*(a[6]-a[25]);p=a[9]+a[22];Q=.595699304*(a[9]-a[22]);ja=F+Q;Ba=.290284677*(F-Q);ba=v+p;sa=.290284677*(v-p);O=a[2]+a[29];R=.970031253*(a[2]-a[29]);B=a[13]+a[18];S=.24298018*(a[13]-a[18]);ka=R+S;Ca=.881921264*(R-S);ca=O+B;ta=.881921264*(O-B);G=a[5]+a[26];T=.85772861*(a[5]-a[26]);D=a[10]+a[21];U=.514102744*(a[10]-a[21]);la=T+U;Da=.471396737*(T-U);da=G+D;ua=.471396737*(G-D);Ga=W+X;$a=
|
|
.98078528*(W-X);Ha=Y+Z;ab=.195090322*(Y-Z);Ia=aa+ba;bb=.831469612*(aa-ba);Ja=ca+da;cb=.555570233*(ca-da);Ka=ea+fa;eb=.98078528*(ea-fa);La=ga+ha;fb=.195090322*(ga-ha);Ma=ia+ja;gb=.831469612*(ia-ja);Na=ka+la;hb=.555570233*(ka-la);Pa=na+oa;kb=.98078528*(na-oa);Qa=pa+qa;lb=.195090322*(pa-qa);Ra=ra+sa;mb=.831469612*(ra-sa);Sa=ta+ua;nb=.555570233*(ta-ua);Ua=wa+xa;qb=.98078528*(wa-xa);Va=ya+za;rb=.195090322*(ya-za);Wa=Aa+Ba;sb=.831469612*(Aa-Ba);Xa=Ca+Da;tb=.555570233*(Ca-Da);xb=Ga+Ha;yb=Ia+Ja;h[15][b]=
|
|
xb+yb;g[0][b]=.707106781*(xb-yb);zb=Ka+La;Ab=Ma+Na;V=zb+Ab;h[14][b]=V;Cb=Pa+Qa;Db=Ra+Sa;va=Cb+Db;h[13][b]=va;Fb=Ua+Va;Gb=Wa+Xa;Ea=Fb+Gb;ma=2*Ea-V;h[12][b]=ma;Jb=$a+ab;Kb=bb+cb;db=Jb+Kb;h[11][b]=db;Mb=eb+fb;Nb=gb+hb;ib=Mb+Nb;Fa=2*ib-ma;h[10][b]=Fa;Qb=kb+lb;Rb=mb+nb;ob=Qb+Rb;Ta=2*ob-va;h[9][b]=Ta;Ub=qb+rb;Vb=sb+tb;ub=Ub+Vb;Ya=2*ub-Ea;Oa=2*Ya-Fa;h[8][b]=Oa;Zb=.923879533*(Ga-Ha);$b=.382683432*(Ia-Ja);ac=Zb+$b;h[7][b]=ac;g[8][b]=1.414213562*(Zb-$b)-ac;bc=.923879533*(Ka-La);cc=.382683432*(Ma-Na);dc=bc+
|
|
cc;Za=2*dc-Oa;h[6][b]=Za;fc=.923879533*(Pa-Qa);gc=.382683432*(Ra-Sa);hc=fc+gc;pb=2*hc-Ta;h[5][b]=pb;jc=.923879533*(Ua-Va);kc=.382683432*(Wa-Xa);lc=jc+kc;vb=2*lc-Ya;jb=2*vb-Za;h[4][b]=jb;oc=.923879533*($a-ab);pc=.382683432*(bb-cb);qc=oc+pc;Lb=2*qc-db;h[3][b]=Lb;rc=1.414213562*(Jb-Kb)-Lb;g[4][b]=rc;g[12][b]=2*(1.414213562*(oc-pc)-qc)-rc;sc=.923879533*(eb-fb);tc=.382683432*(gb-hb);uc=sc+tc;Ob=2*uc-ib;wb=2*Ob-jb;h[2][b]=wb;vc=1.414213562*(Mb-Nb)-Ob;xc=.923879533*(kb-lb);yc=.382683432*(mb-nb);zc=xc+yc;
|
|
Sb=2*zc-ob;Eb=2*Sb-pb;h[1][b]=Eb;Tb=1.414213562*(Cb-Db)-Eb;g[2][b]=Tb;Ac=1.414213562*(Qb-Rb)-Sb;ic=2*Ac-Tb;g[6][b]=ic;Bc=2*(1.414213562*(fc-gc)-hc)-ic;g[10][b]=Bc;g[14][b]=2*(2*(1.414213562*(xc-yc)-zc)-Ac)-Bc;Cc=.923879533*(qb-rb);Dc=.382683432*(sb-tb);Ec=Cc+Dc;Wb=2*Ec-ub;Hb=2*Wb-vb;Xb=1.414213562*(Fb-Gb)-Hb;Bb=2*Hb-wb;h[0][b]=Bb;Ib=1.414213562*(zb-Ab)-Bb;g[1][b]=Ib;Pb=2*Xb-Ib;g[3][b]=Pb;Yb=2*vc-Pb;g[5][b]=Yb;Fc=1.414213562*(Ub-Vb)-Wb;mc=2*Fc-Xb;ec=2*mc-Yb;g[7][b]=ec;nc=2*(1.414213562*(bc-cc)-dc)-
|
|
ec;g[9][b]=nc;Gc=2*(1.414213562*(jc-kc)-lc)-mc;wc=2*Gc-nc;g[11][b]=wc;Hc=2*(2*(1.414213562*(sc-tc)-uc)-vc)-wc;g[13][b]=Hc;g[15][b]=2*(2*(2*(1.414213562*(Cc-Dc)-Ec)-Fc)-Gc)-Hc};var a=[[0,-4.42505E-4,.003250122,-.007003784,.031082153,-.07862854,.100311279,-.572036743,1.144989014,.572036743,.100311279,.07862854,.031082153,.007003784,.003250122,4.42505E-4,0,-4.42505E-4,.003250122,-.007003784,.031082153,-.07862854,.100311279,-.572036743,1.144989014,.572036743,.100311279,.07862854,.031082153,.007003784,
|
|
.003250122,4.42505E-4],[-1.5259E-5,-4.73022E-4,.003326416,-.007919312,.030517578,-.084182739,.090927124,-.600219727,1.144287109,.543823242,.108856201,.073059082,.031478882,.006118774,.003173828,3.96729E-4,-1.5259E-5,-4.73022E-4,.003326416,-.007919312,.030517578,-.084182739,.090927124,-.600219727,1.144287109,.543823242,.108856201,.073059082,.031478882,.006118774,.003173828,3.96729E-4],[-1.5259E-5,-5.34058E-4,.003387451,-.008865356,.029785156,-.089706421,.080688477,-.628295898,1.142211914,.515609741,
|
|
.116577148,.067520142,.031738281,.0052948,.003082275,3.66211E-4,-1.5259E-5,-5.34058E-4,.003387451,-.008865356,.029785156,-.089706421,.080688477,-.628295898,1.142211914,.515609741,.116577148,.067520142,.031738281,.0052948,.003082275,3.66211E-4],[-1.5259E-5,-5.79834E-4,.003433228,-.009841919,.028884888,-.095169067,.069595337,-.656219482,1.138763428,.487472534,.123474121,.06199646,.031845093,.004486084,.002990723,3.20435E-4,-1.5259E-5,-5.79834E-4,.003433228,-.009841919,.028884888,-.095169067,.069595337,
|
|
-.656219482,1.138763428,.487472534,.123474121,.06199646,.031845093,.004486084,.002990723,3.20435E-4],[-1.5259E-5,-6.2561E-4,.003463745,-.010848999,.027801514,-.100540161,.057617187,-.683914185,1.133926392,.459472656,.129577637,.056533813,.031814575,.003723145,.00289917,2.89917E-4,-1.5259E-5,-6.2561E-4,.003463745,-.010848999,.027801514,-.100540161,.057617187,-.683914185,1.133926392,.459472656,.129577637,.056533813,.031814575,.003723145,.00289917,2.89917E-4],[-1.5259E-5,-6.86646E-4,.003479004,-.011886597,
|
|
.026535034,-.105819702,.044784546,-.71131897,1.127746582,.431655884,.134887695,.051132202,.031661987,.003005981,.002792358,2.59399E-4,-1.5259E-5,-6.86646E-4,.003479004,-.011886597,.026535034,-.105819702,.044784546,-.71131897,1.127746582,.431655884,.134887695,.051132202,.031661987,.003005981,.002792358,2.59399E-4],[-1.5259E-5,-7.47681E-4,.003479004,-.012939453,.025085449,-.110946655,.031082153,-.738372803,1.120223999,.404083252,.139450073,.045837402,.031387329,.002334595,.002685547,2.44141E-4,-1.5259E-5,
|
|
-7.47681E-4,.003479004,-.012939453,.025085449,-.110946655,.031082153,-.738372803,1.120223999,.404083252,.139450073,.045837402,.031387329,.002334595,.002685547,2.44141E-4],[-3.0518E-5,-8.08716E-4,.003463745,-.014022827,.023422241,-.115921021,.01651001,-.765029907,1.111373901,.376800537,.143264771,.040634155,.031005859,.001693726,.002578735,2.13623E-4,-3.0518E-5,-8.08716E-4,.003463745,-.014022827,.023422241,-.115921021,.01651001,-.765029907,1.111373901,.376800537,.143264771,.040634155,.031005859,.001693726,
|
|
.002578735,2.13623E-4],[-3.0518E-5,-8.8501E-4,.003417969,-.01512146,.021575928,-.120697021,.001068115,-.791213989,1.101211548,.349868774,.146362305,.035552979,.030532837,.001098633,.002456665,1.98364E-4,-3.0518E-5,-8.8501E-4,.003417969,-.01512146,.021575928,-.120697021,.001068115,-.791213989,1.101211548,.349868774,.146362305,.035552979,.030532837,.001098633,.002456665,1.98364E-4],[-3.0518E-5,-9.61304E-4,.003372192,-.016235352,.01953125,-.125259399,-.015228271,-.816864014,1.089782715,.323318481,.148773193,
|
|
.030609131,.029937744,5.49316E-4,.002349854,1.67847E-4,-3.0518E-5,-9.61304E-4,.003372192,-.016235352,.01953125,-.125259399,-.015228271,-.816864014,1.089782715,.323318481,.148773193,.030609131,.029937744,5.49316E-4,.002349854,1.67847E-4],[-3.0518E-5,-.001037598,.00328064,-.017349243,.01725769,-.129562378,-.03237915,-.841949463,1.07711792,.297210693,.150497437,.025817871,.029281616,3.0518E-5,.002243042,1.52588E-4,-3.0518E-5,-.001037598,.00328064,-.017349243,.01725769,-.129562378,-.03237915,-.841949463,
|
|
1.07711792,.297210693,.150497437,.025817871,.029281616,3.0518E-5,.002243042,1.52588E-4],[-4.5776E-5,-.001113892,.003173828,-.018463135,.014801025,-.133590698,-.050354004,-.866363525,1.063217163,.271591187,.151596069,.021179199,.028533936,-4.42505E-4,.002120972,1.37329E-4,-4.5776E-5,-.001113892,.003173828,-.018463135,.014801025,-.133590698,-.050354004,-.866363525,1.063217163,.271591187,.151596069,.021179199,.028533936,-4.42505E-4,.002120972,1.37329E-4],[-4.5776E-5,-.001205444,.003051758,-.019577026,
|
|
.012115479,-.137298584,-.069168091,-.890090942,1.048156738,.246505737,.152069092,.016708374,.02772522,-8.69751E-4,.00201416,1.2207E-4,-4.5776E-5,-.001205444,.003051758,-.019577026,.012115479,-.137298584,-.069168091,-.890090942,1.048156738,.246505737,.152069092,.016708374,.02772522,-8.69751E-4,.00201416,1.2207E-4],[-6.1035E-5,-.001296997,.002883911,-.020690918,.009231567,-.140670776,-.088775635,-.91305542,1.031936646,.221984863,.15196228,.012420654,.02684021,-.001266479,.001907349,1.06812E-4,-6.1035E-5,
|
|
-.001296997,.002883911,-.020690918,.009231567,-.140670776,-.088775635,-.91305542,1.031936646,.221984863,.15196228,.012420654,.02684021,-.001266479,.001907349,1.06812E-4],[-6.1035E-5,-.00138855,.002700806,-.021789551,.006134033,-.143676758,-.109161377,-.935195923,1.01461792,.198059082,.151306152,.00831604,.025909424,-.001617432,.001785278,1.06812E-4,-6.1035E-5,-.00138855,.002700806,-.021789551,.006134033,-.143676758,-.109161377,-.935195923,1.01461792,.198059082,.151306152,.00831604,.025909424,-.001617432,
|
|
.001785278,1.06812E-4],[-7.6294E-5,-.001480103,.002487183,-.022857666,.002822876,-.146255493,-.130310059,-.956481934,.996246338,.174789429,.150115967,.004394531,.024932861,-.001937866,.001693726,9.1553E-5,-7.6294E-5,-.001480103,.002487183,-.022857666,.002822876,-.146255493,-.130310059,-.956481934,.996246338,.174789429,.150115967,.004394531,.024932861,-.001937866,.001693726,9.1553E-5],[-7.6294E-5,-.001586914,.002227783,-.023910522,-6.86646E-4,-.148422241,-.152206421,-.976852417,.976852417,.152206421,
|
|
.148422241,6.86646E-4,.023910522,-.002227783,.001586914,7.6294E-5,-7.6294E-5,-.001586914,.002227783,-.023910522,-6.86646E-4,-.148422241,-.152206421,-.976852417,.976852417,.152206421,.148422241,6.86646E-4,.023910522,-.002227783,.001586914,7.6294E-5]];g.prototype.full=function(b,d,l){for(var h,c,m,k=0;k<d;++k)for(var r=b.sbsample[k],t=this.filter[k],u=this.phase,H=this.pcm.samples[k],A=0,M=0,n=0;n<l;++n){g.dct32(r[n],u>>1,t[0][u&1],t[1][u&1]);var v=u&-2,p=u-1&15|1,O=t[0][u&1];c=t[0][~u&1];var B=t[1][~u&
|
|
1],G=0,D=0;h=0;m=a[h];_fx=c[0];_fe=O[G];c=_fx[0]*m[p+0];c+=_fx[1]*m[p+14];c+=_fx[2]*m[p+12];c+=_fx[3]*m[p+10];c+=_fx[4]*m[p+8];c+=_fx[5]*m[p+6];c+=_fx[6]*m[p+4];c+=_fx[7]*m[p+2];c=-c;c+=_fe[0]*m[v+0];c+=_fe[1]*m[v+14];c+=_fe[2]*m[v+12];c+=_fe[3]*m[v+10];c+=_fe[4]*m[v+8];c+=_fe[5]*m[v+6];c+=_fe[6]*m[v+4];c+=_fe[7]*m[v+2];H[A++]=c;for(var M=A+30,C=1;16>C;++C)++G,++h,m=a[h],_fo=B[D],_fe=O[G],c=_fo[0]*m[p+0],c+=_fo[1]*m[p+14],c+=_fo[2]*m[p+12],c+=_fo[3]*m[p+10],c+=_fo[4]*m[p+8],c+=_fo[5]*m[p+6],c+=_fo[6]*
|
|
m[p+4],c+=_fo[7]*m[p+2],c=-c,c+=_fe[7]*m[v+2],c+=_fe[6]*m[v+4],c+=_fe[5]*m[v+6],c+=_fe[4]*m[v+8],c+=_fe[3]*m[v+10],c+=_fe[2]*m[v+12],c+=_fe[1]*m[v+14],c+=_fe[0]*m[v+0],H[A++]=c,c=_fe[0]*m[-v+31-16],c+=_fe[1]*m[-v+31-14],c+=_fe[2]*m[-v+31-12],c+=_fe[3]*m[-v+31-10],c+=_fe[4]*m[-v+31-8],c+=_fe[5]*m[-v+31-6],c+=_fe[6]*m[-v+31-4],c+=_fe[7]*m[-v+31-2],c+=_fo[7]*m[-p+31-2],c+=_fo[6]*m[-p+31-4],c+=_fo[5]*m[-p+31-6],c+=_fo[4]*m[-p+31-8],c+=_fo[3]*m[-p+31-10],c+=_fo[2]*m[-p+31-12],c+=_fo[1]*m[-p+31-14],c+=
|
|
_fo[0]*m[-p+31-16],H[M--]=c,++D;++h;m=a[h];_fo=B[D];c=_fo[0]*m[p+0];c+=_fo[1]*m[p+14];c+=_fo[2]*m[p+12];c+=_fo[3]*m[p+10];c+=_fo[4]*m[p+8];c+=_fo[5]*m[p+6];c+=_fo[6]*m[p+4];c+=_fo[7]*m[p+2];H[A]=-c;A+=16;u=(u+1)%16}};g.prototype.frame=function(a){var b=a.header.nchannels(),g=a.header.nbsamples();this.pcm.samplerate=a.header.samplerate;this.pcm.channels=b;this.pcm.length=32*g;this.full(a,b,g);this.phase=(this.phase+g)%16};b.exports=g},{"./utils":15}],14:[function(r,b,m){m.SF_TABLE=new Float32Array([2,
|
|
1.587401051968,1.259921049895,1,.793700525984,.629960524947,.5,.396850262992,.314980262474,.25,.198425131496,.157490131237,.125,.099212565748,.078745065618,.0625,.049606282874,.039372532809,.03125,.024803141437,.019686266405,.015625,.012401570719,.009843133202,.0078125,.006200785359,.004921566601,.00390625,.00310039268,.002460783301,.001953125,.00155019634,.00123039165,9.765625E-4,7.7509817E-4,6.15195825E-4,4.8828125E-4,3.87549085E-4,3.07597913E-4,2.44140625E-4,1.93774542E-4,1.53798956E-4,1.22070313E-4,
|
|
9.6887271E-5,7.6899478E-5,6.1035156E-5,4.8443636E-5,3.8449739E-5,3.0517578E-5,2.4221818E-5,1.922487E-5,1.5258789E-5,1.2110909E-5,9.612435E-6,7.629395E-6,6.055454E-6,4.806217E-6,3.814697E-6,3.027727E-6,2.403109E-6,1.907349E-6,1.513864E-6,1.201554E-6,0]);r=new Uint8Array([4,4,4,4,4,4,6,6,6,8,10,12,16,18,22,28,34,40,46,54,54,192]);b=new Uint8Array([4,4,4,4,4,4,6,6,8,8,10,12,16,20,24,28,34,42,50,54,76,158]);var g=new Uint8Array([4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102,26]),l=new Uint8Array([4,
|
|
4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,10,10,10,12,12,12,14,14,14,16,16,16,20,20,20,26,26,26,66,66,66]),a=new Uint8Array([4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,22,22,22,30,30,30,56,56,56]),e=new Uint8Array([4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12]),d=new Uint8Array([4,4,4,4,4,4,6,6,4,4,4,6,6,6,6,6,6,10,10,10,12,12,12,14,14,14,16,16,16,20,20,20,26,26,26,66,66,66]),q=new Uint8Array([4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,
|
|
8,8,10,10,10,12,12,12,14,14,14,18,18,18,22,22,22,30,30,30,56,56,56]),h=new Uint8Array([4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12]),c=new Uint8Array([6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36]),x=new Uint8Array([6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54]),k=new Uint8Array([4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,32,32,32,44,44,44,12,12,12]),w=new Uint8Array([4,4,4,4,4,4,4,4,4,
|
|
6,6,6,6,6,6,8,8,8,10,10,10,14,14,14,18,18,18,26,26,26,32,32,32,42,42,42,18,18,18]),t=new Uint8Array([4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,30,30,30,40,40,40,18,18,18]),u=new Uint8Array([6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,32,32,32,44,44,44,12,12,12]),H=new Uint8Array([6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,14,14,14,18,18,18,26,26,26,32,32,32,42,42,42,18,18,18]),A=new Uint8Array([6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,
|
|
18,18,18,24,24,24,30,30,30,40,40,40,18,18,18]),M=new Uint8Array([12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2]),n=new Uint8Array([8,8,8,8,8,8,8,8,8,12,12,12,16,16,16,20,20,20,24,24,24,28,28,28,36,36,36,2,2,2,2,2,2,2,2,2,26,26,26]),v=new Uint8Array([12,12,12,4,4,4,8,8,8,12,12,12,16,16,16,20,20,20,24,24,24,28,28,28,36,36,36,2,2,2,2,2,2,2,2,2,26,26,26]);m.SFBWIDTH_TABLE=[{l:r,s:l,m:d},{l:b,s:a,m:q},{l:g,s:e,m:h},{l:c,s:k,m:u},{l:x,s:w,m:H},{l:x,s:t,m:A},{l:x,s:t,m:A},{l:x,s:t,m:A},{l:M,
|
|
s:n,m:v}];m.PRETAB=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0]);m.ROOT_TABLE=new Float32Array([.59460355750136,.70710678118655,.84089641525371,1,1.18920711500272,1.4142135623731,1.68179283050743]);m.CS=new Float32Array([.857492926,.881741997,.949628649,.983314592,.995517816,.999160558,.999899195,.999993155]);m.CA=new Float32Array([-.514495755,-.471731969,-.313377454,-.1819132,-.094574193,-.040965583,-.014198569,-.003699975]);m.COUNT1TABLE_SELECT=1;m.SCALEFAC_SCALE=2;m.PREFLAG=4;m.MIXED_BLOCK_FLAG=
|
|
8;m.I_STEREO=1;m.MS_STEREO=2;m.WINDOW_L=new Float32Array([.043619387,.130526192,.216439614,.3007058,.382683432,.461748613,.537299608,.608761429,.675590208,.737277337,.79335334,.843391446,.887010833,.923879533,.953716951,.976296007,.991444861,.999048222,.999048222,.991444861,.976296007,.953716951,.923879533,.887010833,.843391446,.79335334,.737277337,.675590208,.608761429,.537299608,.461748613,.382683432,.3007058,.216439614,.130526192,.043619387]);m.WINDOW_S=new Float32Array([.130526192,.382683432,
|
|
.608761429,.79335334,.923879533,.991444861,.991444861,.923879533,.79335334,.608761429,.382683432,.130526192]);m.IS_TABLE=new Float32Array([0,.211324865,.366025404,.5,.633974596,.788675135,1]);m.IS_LSF_TABLE=[new Float32Array([.840896415,.707106781,.594603558,.5,.420448208,.353553391,.297301779,.25,.210224104,.176776695,.148650889,.125,.105112052,.088388348,.074325445]),new Float32Array([.707106781,.5,.353553391,.25,.176776695,.125,.088388348,.0625,.044194174,.03125,.022097087,.015625,.011048543,.0078125,
|
|
.005524272])];m.SFLEN_TABLE=[{slen1:0,slen2:0},{slen1:0,slen2:1},{slen1:0,slen2:2},{slen1:0,slen2:3},{slen1:3,slen2:0},{slen1:1,slen2:1},{slen1:1,slen2:2},{slen1:1,slen2:3},{slen1:2,slen2:1},{slen1:2,slen2:2},{slen1:2,slen2:3},{slen1:3,slen2:1},{slen1:3,slen2:2},{slen1:3,slen2:3},{slen1:4,slen2:2},{slen1:4,slen2:3}];m.NSFB_TABLE=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,
|
|
9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]]},{}],15:[function(r,b,m){m.makeArray=function(b,l){l||(l=Float64Array);if(1===b.length)return new l(b[0]);for(var a=[],e=b[0],d=0;d<e;d++)a[d]=m.makeArray(b.slice(1),l);return a}},{}]},{},[1]);
|
|
|