Skip to content

Commit

Permalink
enhancement: resample audio during Push operations (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Aug 8, 2024
1 parent 9d2c59f commit a70dd17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sounddep/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ static void finish_sound_buffer_sdl2_push(struct sound_data* sd, uae_u16* sndbuf
memset(sndbuffer, 0, sd->sndbufsize);
s->silence_written++; // In push mode no sound gen means no audio push so this might not incremented frequently
}

int avail = SDL_GetQueuedAudioSize(s->dev);
docorrection(s, (s->sndbufsize - avail) * 1000 / s->sndbufsize, (float)(s->sndbufsize - avail), 100);

SDL_QueueAudio(s->dev, sndbuffer, sd->sndbufsize);
}

Expand Down

0 comments on commit a70dd17

Please sign in to comment.