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 24, 2024
1 parent 6b1c25b commit 8bf7b66
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 8bf7b66

Please sign in to comment.