Struct kira::Frame[][src]

pub struct Frame {
    pub left: f32,
    pub right: f32,
}
Expand description

An audio sample with a left and right channel.

Fields

left: f32

The sample for the left channel.

right: f32

The sample for the right channel.

Implementations

impl Frame[src]

pub fn new(left: f32, right: f32) -> Self[src]

Creates a frame with the given left and right values.

pub fn from_mono(value: f32) -> Self[src]

Creates a frame with both the left and right channels set to the same value.

pub fn from_i32(left: i32, right: i32, bit_depth: u32) -> Self[src]

Creates a frame from i32s with the given bit depth.

pub fn panned(self, x: f32) -> Self[src]

Pans a frame to the left or right.

An x of 0 represents a hard left panning, an x of 1 represents a hard right panning.

Trait Implementations

impl Add<Frame> for Frame[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, rhs: Self) -> Self::Output[src]

Performs the + operation. Read more

impl AddAssign<Frame> for Frame[src]

fn add_assign(&mut self, rhs: Self)[src]

Performs the += operation. Read more

impl Clone for Frame[src]

fn clone(&self) -> Frame[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Frame[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Div<f32> for Frame[src]

type Output = Self

The resulting type after applying the / operator.

fn div(self, rhs: f32) -> Self::Output[src]

Performs the / operation. Read more

impl DivAssign<f32> for Frame[src]

fn div_assign(&mut self, rhs: f32)[src]

Performs the /= operation. Read more

impl Mul<f32> for Frame[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, rhs: f32) -> Self::Output[src]

Performs the * operation. Read more

impl MulAssign<f32> for Frame[src]

fn mul_assign(&mut self, rhs: f32)[src]

Performs the *= operation. Read more

impl Neg for Frame[src]

type Output = Self

The resulting type after applying the - operator.

fn neg(self) -> Self::Output[src]

Performs the unary - operation. Read more

impl PartialEq<Frame> for Frame[src]

fn eq(&self, other: &Frame) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Frame) -> bool[src]

This method tests for !=.

impl Sub<Frame> for Frame[src]

type Output = Self

The resulting type after applying the - operator.

fn sub(self, rhs: Self) -> Self::Output[src]

Performs the - operation. Read more

impl SubAssign<Frame> for Frame[src]

fn sub_assign(&mut self, rhs: Self)[src]

Performs the -= operation. Read more

impl Copy for Frame[src]

impl StructuralPartialEq for Frame[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V