Struct kira::Frame[][src]

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

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.

impl AddAssign<Frame> for Frame[src]

impl Clone for Frame[src]

impl Copy for Frame[src]

impl Debug for Frame[src]

impl Div<f32> for Frame[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<f32> for Frame[src]

impl Mul<f32> for Frame[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<f32> for Frame[src]

impl Neg for Frame[src]

type Output = Self

The resulting type after applying the - operator.

impl PartialEq<Frame> for Frame[src]

impl StructuralPartialEq for Frame[src]

impl Sub<Frame> for Frame[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Frame> 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]

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.

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