Web Audio Offline Context and Analyser Node

前端 未结 2 1814
梦如初夏
梦如初夏 2020-12-21 02:27

Is it possible to use the Analyser node in the offlineAudioContext to do frequency analysis?

I found out that ScriptProcessor

相关标签:
2条回答
  • 2020-12-21 02:54

    The analyser isn't really intended to be used in the offlineContext; in fact, it was originally named "RealtimeAnalyser". But even more importantly, right now you won't get consistent functionality from script processors in offline contexts, either.

    0 讨论(0)
  • 2020-12-21 03:04

    An alternative is to use the suspend and resume methods available for an OfflineAudioContext. After suspending, you can use your analyser node to get the desired time and/or frequency domain data. Since the context is stopped, this works just fine. If you're going to do this several times, you'll need to schedule a stop for the next time before resuming.

    Unfortunately, AFAIK, only Chrome has implemented suspend for an OfflineAudioContext

    0 讨论(0)
提交回复
热议问题