pub struct ToneVoice { /* private fields */ }Expand description
Tier A tone oscillator with optional auto-stop by duration.
Implementations§
Source§impl ToneVoice
impl ToneVoice
pub const fn new() -> Self
pub fn start(&mut self, params: ToneParams, sample_rate_hz: u32)
pub fn stop(&mut self)
pub fn is_active(&self) -> bool
Sourcepub const fn carrier_hz(&self, sample_rate_hz: u32) -> u32
pub const fn carrier_hz(&self, sample_rate_hz: u32) -> u32
Carrier in Hz derived from the phase increment (for FM buzzer backends).
pub fn next_sample(&mut self) -> Option<i8>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToneVoice
impl RefUnwindSafe for ToneVoice
impl Send for ToneVoice
impl Sync for ToneVoice
impl Unpin for ToneVoice
impl UnsafeUnpin for ToneVoice
impl UnwindSafe for ToneVoice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more