老是的这张WEB Audio API关系图瞬间就把脉络清晰的理清
AudioBufferSourceNode与AnalyserNode与全局对象AudioContext的关系理清就比较好理解了
查了很多API文档 ,再回来看这张图有种茅塞顿开的感觉
AudioBufferSourceNode与AnalyserNode与全局对象AudioContext的关系理清就比较好理解了
查了很多API文档 ,再回来看这张图有种茅塞顿开的感觉
2018-01-13
可以独立变量
var RAF = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
window.setTimeout(callback, 1000 / 60);
};
})();
var RAF = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
window.setTimeout(callback, 1000 / 60);
};
})();
2018-01-10
play(buffer){
this.bufferSource&&this.stop();
this.bufferSource=AC.createBufferSource();
this.bufferSource.buffer=buffer;
this.bufferSource.connect(gainNode);
this.bufferSource.start();
},
stop(){
this.bufferSource.stop()
}
将播放和暂停的代码独立出来,然后在每次播放之前先调用暂停,就可以解决同步播放的问题
this.bufferSource&&this.stop();
this.bufferSource=AC.createBufferSource();
this.bufferSource.buffer=buffer;
this.bufferSource.connect(gainNode);
this.bufferSource.start();
},
stop(){
this.bufferSource.stop()
}
将播放和暂停的代码独立出来,然后在每次播放之前先调用暂停,就可以解决同步播放的问题
2018-01-10
<% music.forEach(function(name){ %>
<li><%= name %></li>
<% }) %>
一直报错,愁死了
<li><%= name %></li>
<% }) %>
一直报错,愁死了
2017-11-21