문제

Chrome의 웹 오디오의 가장 기본적인 (i 생각)이 있습니다.

웹 오디오가 활성화 된 Chrome 13에 있지만 내 사운드는 방금 재생되지 않습니다.나는 그것이로드되면 (http://pieterHordijk.com/sandbox/html5-audio-api/webkit-audiocontext-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는 IT를 출력에 연결해야했습니다.

source.connect(context.destination);
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top