【问题标题】:what is the time unit for Web Audio API 'noteOn()'Web Audio API 'noteOn()' 的时间单位是多少
【发布时间】:2013-03-27 01:21:16
【问题描述】:

我正在尝试使用网络音频 api 'noteOn(time)' 播放声音,但我不确定时间单位是什么。

是毫秒吗?还是第二个?

【问题讨论】:

    标签: web-audio-api


    【解决方案1】:

    几秒钟。

    时间与音频上下文的 currentTime 相关,可以这样访问:

    var context = new audioContext();
    
    //....
    
    note.noteOn(context.currentTime); //will play now
    
    //....
    
    note.noteOn(context.currentTime + 1); //will play in one second
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-25
      • 1970-01-01
      • 2016-06-23
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多