Assume createBufferSource got a sample if not a string.
[pwl6.git] / src / yuu / audio.js
index 881924e..7a66e70 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright 2014 Yukkuri Games
    Licensed under the terms of the GNU GPL v2 or later
-   @license http://www.gnu.org/licenses/gpl-2.0.html
-   @source: http://yukkurigames.com/yuu/
+   @license https://www.gnu.org/licenses/gpl-2.0.html
+   @source: https://yukkurigames.com/yuu/
 */
 
 (function (yuu) {
 
         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;