Skip to content

Commit

Permalink
fix #275544: popping noise
Browse files Browse the repository at this point in the history
Use the copy of the `activeVoices` array for proper output audio processing.
  • Loading branch information
anatoly-os committed Sep 5, 2018
1 parent 9443b37 commit ab9bf85
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fluid/fluid.cpp
Expand Up @@ -401,7 +401,9 @@ void Fluid::update_presets()
void Fluid::process(unsigned len, float* out, float* effect1, float* effect2)
{
if (mutex.tryLock()) {
for (Voice* v : activeVoices)
//we have to copy voices array for proper output sound processing in for loop
auto tempVoices = activeVoices;
for (Voice* v : tempVoices)
v->write(len, out, effect1, effect2);
mutex.unlock();
}
Expand Down

0 comments on commit ab9bf85

Please sign in to comment.