Skip to main content

Wave

Struct Wave 

Source
pub struct Wave<'a>(/* private fields */);

Implementations§

Source§

impl<'a> Wave<'a>

Source

pub unsafe fn unwrap(self) -> Wave

Take the raw ffi type. Must manually free memory by calling the proper unload function

Source§

impl<'aud> Wave<'aud>

Source

pub fn frame_count(&self) -> u32

Source

pub fn sample_rate(&self) -> u32

Source

pub fn sample_size(&self) -> u32

Source

pub fn channels(&self) -> u32

Source

pub unsafe fn inner(self) -> Wave

Source

pub fn is_wave_valid(&self) -> bool

Source

pub fn export(&self, filename: impl AsRef<Path>) -> bool

Export wave file. Extension must be .wav or .raw

Source

pub fn format(&mut self, sample_rate: i32, sample_size: i32, channels: i32)

Converts wave data to desired format.

Source

pub fn crop(&mut self, init_sample: i32, final_sample: i32)

Crops a wave to defined sample range.

Source

pub fn load_samples(&self) -> WaveSamples

Load samples data from wave as a floats array NOTE 1: Returned sample values are normalized to range [-1..1] NOTE 2: Sample data allocated should be freed with UnloadWaveSamples()

Trait Implementations§

Source§

impl<'a> AsMut<Wave> for Wave<'a>

Source§

fn as_mut(&mut self) -> &mut Wave

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<'a> AsRef<Wave> for Wave<'a>

Source§

fn as_ref(&self) -> &Wave

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Debug for Wave<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Deref for Wave<'a>

Source§

type Target = Wave

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Wave<'a> as Deref>::Target

Dereferences the value.
Source§

impl<'a> DerefMut for Wave<'a>

Source§

fn deref_mut(&mut self) -> &mut <Wave<'a> as Deref>::Target

Mutably dereferences the value.
Source§

impl<'a> Drop for Wave<'a>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Wave<'a>

§

impl<'a> RefUnwindSafe for Wave<'a>

§

impl<'a> !Send for Wave<'a>

§

impl<'a> !Sync for Wave<'a>

§

impl<'a> Unpin for Wave<'a>

§

impl<'a> UnsafeUnpin for Wave<'a>

§

impl<'a> UnwindSafe for Wave<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.