From: Joe Wreschnig Date: Fri, 24 Apr 2015 22:29:35 +0000 (+0200) Subject: Assume createBufferSource got a sample if not a string. X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=commitdiff_plain;h=299c9a8900ae7a4b8289db0dedc768a48e2856e3 Assume createBufferSource got a sample if not a string. --- diff --git a/src/yuu/audio.js b/src/yuu/audio.js index fb352ae..7a66e70 100644 --- a/src/yuu/audio.js +++ b/src/yuu/audio.js @@ -107,7 +107,9 @@ createBufferSource: function (path) { var source = this._ctx.createBufferSource(); - var sample = new yuu.AudioSample(path, this); + var sample = yf.isString(path) + ? new yuu.AudioSample(path, this) + : path; if ((source.buffer = sample.buffer) === null) { sample.ready.then(function () { source.buffer = sample.buffer;