OfflineAudioContext tail time when rendering a reverb effect #2557
-
Hello everybody, I'm trying to implement something with OfflineAudioContext but I'm stuck on this problem: 1-I have a reverb effect AudioWorkletProcessor with a decay value that repeats the input sound several times like an echo, what it's called tail time. 2-If I use a new AudioContext, connect the reverb node, and reproduce a track then I can hear the original audio + the tail time that the effect adds to the original track length with the echo effect. The audio reproduces until the effect stops rendering the echo
3-BUT when I use the OfflineAudioContext to try to get the track + reverb effect applied, I can listen to the rendered result audio but the track stops at the original length of the track, so I cannot hear all the effect tail time. It stops rendering before the effect ends
Is there a way to tell the OfflineAudioContext that should render until the effect stops? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You would probably need to increase the new OfflineAudioContext({
length: decodedBuffer.length + TAIL_TIME_IN_SAMPLES,
numberOfChannels: decodedBuffer.numberOfChannels,
sampleRate: decodedBuffer.sampleRate
}); |
Beta Was this translation helpful? Give feedback.
-
I tested that and the song duration is increased, but with silence |
Beta Was this translation helpful? Give feedback.
You would probably need to increase the
length
of yourOfflineAudioContext
by the number of samples of the tail time.