currentTime: { alias: "_ctx.currentTime" },
- decodeAudioData: function (data) {
+ decodeAudioData: function (data, hint) {
var ctx = this._ctx;
try {
return ctx.decodeAudioData(data);
ctx.decodeAudioData(data, function (buffer) {
resolve(buffer);
}, function () {
- reject(new Error("Error decoding audio buffer"));
+ reject(new Error("Error decoding audio buffer"
+ + (hint ? ": " + hint : "")));
});
});
}
var url = yuu.resourcePath(path, "sound", "wav");
this.data = null;
this.ready = yuu.GET(url, { responseType: "arraybuffer" })
- .then(ctx.decodeAudioData.bind(ctx))
+ .then(function (data) {
+ return ctx.decodeAudioData(data, url);
+ })
.then(yf.setter.bind(this, "buffer"))
.then(yf.K(this));
}