projects
/
pwl6.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4333a41
)
Include URL in audio load error message.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Mon, 13 Jul 2015 22:39:28 +0000
(
00:39
+0200)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Mon, 13 Jul 2015 22:39:28 +0000
(
00:39
+0200)
src/yuu/audio.js
patch
|
blob
|
history
diff --git
a/src/yuu/audio.js
b/src/yuu/audio.js
index
0e543a7
..
cc00cf7
100644
(file)
--- a/
src/yuu/audio.js
+++ b/
src/yuu/audio.js
@@
-89,7
+89,7
@@
currentTime: { alias: "_ctx.currentTime" },
currentTime: { alias: "_ctx.currentTime" },
- decodeAudioData: function (data) {
+ decodeAudioData: function (data
, hint
) {
var ctx = this._ctx;
try {
return ctx.decodeAudioData(data);
var ctx = this._ctx;
try {
return ctx.decodeAudioData(data);
@@
-98,7
+98,8
@@
ctx.decodeAudioData(data, function (buffer) {
resolve(buffer);
}, function () {
ctx.decodeAudioData(data, function (buffer) {
resolve(buffer);
}, function () {
- reject(new Error("Error decoding audio buffer"));
+ reject(new Error("Error decoding audio buffer"
+ + (hint ? ": " + hint : "")));
});
});
}
});
});
}
@@
-174,7
+175,9
@@
var url = yuu.resourcePath(path, "sound", "wav");
this.data = null;
this.ready = yuu.GET(url, { responseType: "arraybuffer" })
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));
}
.then(yf.setter.bind(this, "buffer"))
.then(yf.K(this));
}