pub struct Frame {
pub left: f32,
pub right: f32,
}Expand description
A stereo audio sample.
Fields§
§left: f32The sample for the left channel.
right: f32The sample for the right channel.
Implementations§
source§impl Frame
impl Frame
sourcepub fn new(left: f32, right: f32) -> Self
pub fn new(left: f32, right: f32) -> Self
Creates a frame with the given left and right values.
sourcepub fn from_mono(value: f32) -> Self
pub fn from_mono(value: f32) -> Self
Creates a frame with both the left and right channels set to the same value.
Trait Implementations§
source§impl AddAssign for Frame
impl AddAssign for Frame
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresource§impl<'de> Deserialize<'de> for Frame
impl<'de> Deserialize<'de> for Frame
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl DivAssign<f32> for Frame
impl DivAssign<f32> for Frame
source§fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the
/= operation. Read moresource§impl MulAssign<f32> for Frame
impl MulAssign<f32> for Frame
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the
*= operation. Read moresource§impl PartialEq for Frame
impl PartialEq for Frame
source§impl SubAssign for Frame
impl SubAssign for Frame
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Frame
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
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