Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome Chrome网络音频没有';我不能播放我的音频_Google Chrome_Web Audio Api - Fatal编程技术网

Google chrome Chrome网络音频没有';我不能播放我的音频

Google chrome Chrome网络音频没有';我不能播放我的音频,google-chrome,web-audio-api,Google Chrome,Web Audio Api,我只是拥有Chrome网络音频的最基本(我认为)实现 我在Chrome13上启用了网络音频,但我的声音无法播放。我看到它上膛了(http://pieterhordijk.com/sandbox/html5-audio-api/webkit-audiocontext-interface),但它就是不起作用 window.onload = init; var context; var source; function loadSample(url) { var request = new

我只是拥有Chrome网络音频的最基本(我认为)实现

我在Chrome13上启用了网络音频,但我的声音无法播放。我看到它上膛了(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");
}

好的,我自己找到了答案,我必须把它和输出连接起来

source.connect(context.destination);