pub struct Voice<'a> {
pub source: VoiceSource<'a>,
pub priority: u8,
/* private fields */
}Expand description
One of two mixer voices.
Fields§
§source: VoiceSource<'a>§priority: u8Implementations§
Source§impl<'a> Voice<'a>
impl<'a> Voice<'a>
pub const fn silent(sample_rate_hz: u32) -> Self
pub fn set_gain_q8(&mut self, gain_q8: u8)
pub fn gain_q8(self) -> u8
pub fn trigger_adsr(&mut self, spec: AdsrSpec)
pub fn release(&mut self)
pub fn stop_immediate(&mut self)
pub fn is_audible(&self) -> bool
pub fn tick_envelope(&mut self)
Sourcepub fn next_sample(&mut self) -> Option<i8>
pub fn next_sample(&mut self) -> Option<i8>
Sample after envelope and per-voice gain.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Voice<'a>
impl<'a> RefUnwindSafe for Voice<'a>
impl<'a> Send for Voice<'a>
impl<'a> Sync for Voice<'a>
impl<'a> Unpin for Voice<'a>
impl<'a> UnsafeUnpin for Voice<'a>
impl<'a> UnwindSafe for Voice<'a>
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