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 fb352ae..7a66e70 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;