[−][src]Struct sdl2::audio::AudioCVT
Methods
impl AudioCVT
[src]
pub fn new(
src_format: AudioFormat,
src_channels: u8,
src_rate: i32,
dst_format: AudioFormat,
dst_channels: u8,
dst_rate: i32
) -> Result<AudioCVT, String>
[src]
src_format: AudioFormat,
src_channels: u8,
src_rate: i32,
dst_format: AudioFormat,
dst_channels: u8,
dst_rate: i32
) -> Result<AudioCVT, String>
pub fn convert(&self, src: Vec<u8>) -> Vec<u8>
[src]
Convert audio data to a desired audio format.
The src
vector is adjusted to the capacity necessary to perform
the conversion in place; then it is passed to the SDL library.
Certain conversions may cause buffer overflows. See AngryLawyer/rust-sdl2 issue #270.
pub fn is_conversion_needed(&self) -> bool
[src]
Checks if any conversion is needed. i.e. if the buffer that goes
into convert()
is unchanged from the result.
pub fn capacity(&self, src_len: usize) -> usize
[src]
Gets the buffer capacity that can contain both the original and converted data.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AudioCVT
impl !Send for AudioCVT
impl !Sync for AudioCVT
impl Unpin for AudioCVT
impl UnwindSafe for AudioCVT
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,