3DTune-In / 3dti_AudioToolkit

3D Tune-In Toolkit is a custom open-source C++ library developed within the EU-funded project 3D Tune-In. The Toolkit provides a high level of realism and immersiveness within binaural 3D audio simulations, while allowing for the emulation of hearing aid devices and of different typologies of hearing loss.
GNU General Public License v3.0
219 stars 44 forks source link

Test application crashes when playing with multiple sources and convolutional reverb #25

Open areyesl opened 8 months ago

areyesl commented 8 months ago

Actions to crash:

It seems that when reverb is disabled, ir remembers that two sources were being included in the reverb. Then, when it is enabled again, only one is active and that seems to create a conflct.

More specifically, the problem occurs when two sources are loaded and one of them is stopped. The loop in CEnvironment::ProcessVirtualAmbisonicReverbThreedimensional() iterates through all sources, not only those being played.

In Environment.cpp, line 1032, it is checked if every source has updated the buffer. When a source is stopped, it doesn't update the buffer, but this control prevents the crash. However, when the reverb is switched on, in the first frame, this control fails and the app crashes