Tone.js icon indicating copy to clipboard operation
Tone.js copied to clipboard

Include added inputs to buffer data

Open charlesmooredev opened this issue 3 years ago • 1 comments
trafficstars

Currently when creating a player with ToneJS to gather data points to create a waveform, if you apply compressors or gains, etc none of that gets applied to the buffer data.

Is there a way that once you connect those effects to the player that the data points would reflect those effects added?

Example: I add a Tone.Compressor() with attack, release, ratio, and knee could the data points that are returned show those changes that are applied rather than the original data from the audio?

charlesmooredev avatar Nov 03 '22 14:11 charlesmooredev

If you're trying to render a waveform of the entire post-processed buffer, you'd need to pre-render the modified buffer using Tone.Offline() (which can be an expensive operation depending on buffer length). Otherwise if you're just trying to create a realtime waveform as in an oscilloscope, then that's much easier, simply connect the last node in the effects chain to your AnalyserNode or Tone.Waveform.

marcelblum avatar Nov 04 '22 02:11 marcelblum