请家伙即时股票我需要帮助与这些我不断收到错误,缓冲区列表undefined,loadDogSound undefined.if没有得到任何错误,它不玩。网络音频api将不会播放声音
预先感谢您。
<script>
window.onload = init;
var context;
var bufferLoader;
function init() {
// Fix up prefixing
window.AudioContext = window.AudioContext || window.webkitAudioContext;
context = new AudioContext();
bufferLoader = new BufferLoader(
context,
[
'audio/b.mp3',
'audio/a.mp3',
],
finishedLoading
);
bufferLoader.load();
}
function finishedLoading(bufferList) {
\t context = new AudioContext();
// Create two sources and play them both together.
var source1 = context.createBufferSource();
var source2 = context.createBufferSource();
source1.buffer = bufferList[0];
source2.buffer = bufferList[1];
source1.connect(context.destination);
source2.connect(context.destination);
source1.start(0);
source2.start(0);
}
</script>
你使用什么浏览器?不久前,这是非常实验性的,你必须用铬合金来打开它。今天应该可以在几乎所有流行的浏览器中使用。检查这里:http://caniuse.com/#search=AudioContext – oscargilfc