Skip to content

Commit

Permalink
Fix: hearing damage when all direct effects are disabled. (closes #70)
Browse files Browse the repository at this point in the history
It seems that iplAudioBufferMix doesn't clear the buffers,
and doing it by hand seems to avoid weird audio.
  • Loading branch information
stechyo committed Sep 21, 2024
1 parent 6b1c25b commit 0d45815
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ int32_t SteamAudioStreamPlayback::_mix(AudioFrame *buffer, double rate_scale, in
ls->fx.direct, &ls->direct_outputs,
&ls->bufs.in, &ls->bufs.direct);
} else {
for (int i = 0; i < ls->bufs.direct.numChannels; i++) {
for (int j = 0; j < ls->bufs.direct.numSamples; j++) {
ls->bufs.direct.data[i][j] = 0.0f;
}
}

iplAudioBufferMix(gs->ctx, &ls->bufs.in, &ls->bufs.direct);
}

Expand Down

0 comments on commit 0d45815

Please sign in to comment.