Skip to content

Commit

Permalink
Fixed crackling sound when audio is enabled/disabled (#303).
Browse files Browse the repository at this point in the history
  • Loading branch information
punesemu committed Feb 19, 2024
1 parent 21d4598 commit cb6d8f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/audio/blipbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ void audio_end_frame_blipbuf(void) {
for (i = 0; i < blipbuf.samples.count; i++) {
static SWORD data = 0;

if (cfg->apu.channel[APU_MASTER]) {
data = (SWORD)(((float)blipbuf.samples.data[i] * apu_pre_amp) * cfg->apu.volume[APU_MASTER]);
}
data = cfg->apu.channel[APU_MASTER]
? (SWORD)(((float)blipbuf.samples.data[i] * apu_pre_amp) * cfg->apu.volume[APU_MASTER])
: 0;
audio_channels_tick(data);

if (snd.cache->write == (SWORD *)snd.cache->end) {
Expand Down

0 comments on commit cb6d8f5

Please sign in to comment.