【问题标题】:WebAudio activeSourceCountWebAudio activeSourceCount
【发布时间】:2013-10-24 04:53:22
【问题描述】:

这是我的代码:

var ac = new webkitAudioContext();

按下播放按钮时:

var source = ac.createBufferSource();
source.buffer = audioTrackBuffer;
source.connect(ac.destination);
source.noteOn(0);

按下停止按钮时:

source.noteOff(0);
source.disconnect();

每按一次播放按钮ac.activeSourceCount 递增。

当我noteOff()disconnect() 源时,为什么activeSourceCount 不递减?

【问题讨论】:

    标签: javascript google-chrome web-audio-api


    【解决方案1】:

    看起来它已从规范中删除:https://dvcs.w3.org/hg/audio/rev/cfe4ae147c64

    相关讨论在这里:http://lists.w3.org/Archives/Public/public-audio/2013AprJun/0308.html

    基本上,由于他们添加了“结束”事件,我认为您现在可以自己跟踪这一点。

    【讨论】:

    • 哦,好的!谢谢,凯文!
    • 是的。这将很快从 Blink 中删除。
    猜你喜欢
    • 2021-06-05
    • 2013-01-15
    • 2019-06-04
    • 1970-01-01
    • 2016-09-14
    • 2016-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多