diff --git a/src/apu.rs b/src/apu.rs index 8851570..093f204 100644 --- a/src/apu.rs +++ b/src/apu.rs @@ -11,7 +11,7 @@ mod types; const WAVE_PATTERN_RAM_LEN: usize = 0x10; -const SAMPLE_RATE: u32 = 48000; // Hz +const SAMPLE_RATE: u32 = 44100; // Hz const AUDIO_BUFFER_LEN: usize = 512; const CHANNEL_COUNT: usize = 2; const SAMPLE_INCREMENT: u64 = SAMPLE_RATE as u64; diff --git a/src/apu/gen.rs b/src/apu/gen.rs index 4db82b1..315a8fb 100644 --- a/src/apu/gen.rs +++ b/src/apu/gen.rs @@ -1,5 +1,5 @@ use super::{AUDIO_BUFFER_LEN, CHANNEL_COUNT, SAMPLE_RATE}; -use crossbeam_channel::{Receiver, Sender, TrySendError}; +use crossbeam_channel::{Receiver, SendError, Sender}; use rodio::Source; use std::collections::VecDeque; @@ -22,8 +22,8 @@ pub struct AudioSender { } impl AudioSender { - pub(crate) fn send_samples(&self, left: T, right: T) -> Result<(), TrySendError> { - self.inner.try_send(left).and(self.inner.try_send(right))?; + pub(crate) fn send_samples(&self, left: T, right: T) -> Result<(), SendError> { + self.inner.send(left).and(self.inner.send(right))?; Ok(()) } }