Struct kira::arrangement::SoundClip[][src]

pub struct SoundClip {
    pub sound_id: SoundId,
    pub clip_time_range: (f64, f64),
    pub sound_time_range: (f64, f64),
}

A segment of a sound in an arrangement.

Fields

sound_id: SoundId

The ID of the sound.

clip_time_range: (f64, f64)

The start and end point of the clip.

sound_time_range: (f64, f64)

The start and end point of the sound.

This range of the sound is stretched over the range of the clip.

Implementations

impl SoundClip[src]

pub fn new(sound_handle: &SoundHandle, clip_start_time: f64) -> Self[src]

Creates a new sound clip that starts at the specified time and contains the whole sound without any cropping or speed up/slow down.

pub fn duration(&self) -> f64[src]

Gets the duration of the sound clip.

pub fn stretch(self, factor: f64) -> Self[src]

Increases the length of the clip by the given factor.

A factor greater than 1 will slow down the sound, and a factor less than 1 will speed it up.

pub fn trim(self, duration: f64) -> Self[src]

Sets the duration of the clip, preserving the playback rate of the sound.

Trait Implementations

impl Clone for SoundClip[src]

impl Copy for SoundClip[src]

impl Debug for SoundClip[src]

Auto Trait Implementations

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>,