From 299c9a8900ae7a4b8289db0dedc768a48e2856e3 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sat, 25 Apr 2015 00:29:35 +0200 Subject: [PATCH] Assume createBufferSource got a sample if not a string. --- src/yuu/audio.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2