Struct sdl2::audio::AudioCVT
[−]
[src]
pub struct AudioCVT { /* fields omitted */ }
Methods
impl AudioCVT
[src]
fn new(
src_format: AudioFormat,
src_channels: u8,
src_rate: i32,
dst_format: AudioFormat,
dst_channels: u8,
dst_rate: i32
) -> Result<AudioCVT, String>
src_format: AudioFormat,
src_channels: u8,
src_rate: i32,
dst_format: AudioFormat,
dst_channels: u8,
dst_rate: i32
) -> Result<AudioCVT, String>
fn convert(&self, src: Vec<u8>) -> Vec<u8>
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.
fn is_conversion_needed(&self) -> bool
Checks if any conversion is needed. i.e. if the buffer that goes
into convert()
is unchanged from the result.
fn capacity(&self, src_len: usize) -> usize
Gets the buffer capacity that can contain both the original and converted data.
Trait Implementations
impl Copy for AudioCVT
[src]
impl Clone for AudioCVT
[src]
fn clone(&self) -> AudioCVT
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more