Skip to content

Commit

Permalink
Fix small bug in the TUI library
Browse files Browse the repository at this point in the history
Signed-off-by: Amjad Alsharafi <[email protected]>
  • Loading branch information
Amjad50 committed Oct 19, 2024
1 parent 47e29c6 commit 2b03477
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plastic_tui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ impl Ui {
self.nes.clock_for_frame();
self.display(&mut terminal, &fps);

// take the buffer in all cases, otherwise the audio will keep accumulating in memory
let audio_buffer = self.nes.audio_buffer();
if let Some(ref mut player) = self.audio_player {
let audio_buffer = process_audio(&self.nes.audio_buffer(), 1.0);
let audio_buffer = process_audio(&audio_buffer, 1.0);
player.queue(&audio_buffer);
}

Expand Down

0 comments on commit 2b03477

Please sign in to comment.