Assume createBufferSource got a sample if not a string.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Fri, 24 Apr 2015 22:29:35 +0000 (00:29 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Fri, 24 Apr 2015 22:29:35 +0000 (00:29 +0200)
src/yuu/audio.js

index fb352aeb9a7686beb2e4d924ab030eadc3c66cac..7a66e708e920c10367758522af2c1eead5e25d74 100644 (file)
 
         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;