Assume createBufferSource got a sample if not a string.
[pwl6.git] / 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;