質問

クロムのWebオーディオの実装を最も基本的な(私は思う)。

私はWebオーディオが有効になっているChrome 13にいますが、サウンドは遊ばないだけです。私はそれがロードされるのを見ます(http://pieterhordijk.com/sandbox/html5-audio-api/webkit-AudioContext-Interface)、それは遊ばないだけです。

window.onload = init;

var context;
var source;

function loadSample(url) {
    var request = new XMLHttpRequest();
    request.open("GET", url, true);
    request.responseType = "arraybuffer";

    request.onload = function() {
      source.buffer = context.createBuffer(request.response, false);
      source.looping = true;
      source.noteOn(0);
    }

    request.send();
}

function init()
{
    context = new webkitAudioContext();
    source = context.createBufferSource();

    loadSample("/sandbox/test.oga");
}
.

役に立ちましたか?

解決

OK私がそれを出力に接続しなければならなかった答えを見つけた。

source.connect(context.destination);
.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top