diff --git a/frontends/sdl/src/audio.rs b/frontends/sdl/src/audio.rs index 8b628d04b016925c49d49998867c447ac8da1105..5284f5fae7814bf441c0eb248c990b16930a6d1d 100644 --- a/frontends/sdl/src/audio.rs +++ b/frontends/sdl/src/audio.rs @@ -9,12 +9,12 @@ pub struct Audio { } impl Audio { - pub fn new(sdl: &Sdl, freq: Option<i32>, channels: Option<u8>, samples: Option<u16>) -> Self { + pub fn new(sdl: &Sdl, freq: i32, channels: u8, samples: Option<u16>) -> Self { let audio_subsystem = sdl.audio().unwrap(); let desired_spec = AudioSpecDesired { - freq: Some(freq.unwrap_or(44100)), - channels: Some(channels.unwrap_or(2)), + freq: Some(freq), + channels: Some(channels), samples: Some(samples.unwrap_or(4096)), }; diff --git a/frontends/sdl/src/main.rs b/frontends/sdl/src/main.rs index 72afac1cc8c1e65ea54274b5938a60dbad85b878..01e3e2cb793fbfc4201826a77a3d3dc701e4845e 100644 --- a/frontends/sdl/src/main.rs +++ b/frontends/sdl/src/main.rs @@ -207,8 +207,8 @@ impl Emulator { pub fn start_audio(&mut self, sdl: &Sdl) { self.audio = Some(Audio::new( sdl, - Some(self.system.audio_sampling_rate() as i32), - Some(self.system.audio_channels()), + self.system.audio_sampling_rate() as i32, + self.system.audio_channels(), None, )); }