pub struct WaveFormat {
pub wave_fmt: WAVEFORMATEXTENSIBLE,
}
Expand description
Struct wrapping a WAVEFORMATEXTENSIBLE format descriptor.
Fields§
§wave_fmt: WAVEFORMATEXTENSIBLE
Implementations§
Source§impl WaveFormat
impl WaveFormat
Sourcepub fn new(
storebits: usize,
validbits: usize,
sample_type: &SampleType,
samplerate: usize,
channels: usize,
channel_mask: Option<u32>,
) -> Self
pub fn new( storebits: usize, validbits: usize, sample_type: &SampleType, samplerate: usize, channels: usize, channel_mask: Option<u32>, ) -> Self
Build a WAVEFORMATEXTENSIBLE struct for the given parameters.
channel_mask
is optional. If a mask is provided, it will be used. If not, a default mask will be created.
This can be used to work around quirks for some device drivers.
If the default is not accepted, try again using a zero mask, Some(0)
.
Sourcepub fn from_waveformatex(wavefmt: WAVEFORMATEX) -> Result<Self, WasapiError>
pub fn from_waveformatex(wavefmt: WAVEFORMATEX) -> Result<Self, WasapiError>
Create from a WAVEFORMATEX structure
Sourcepub fn to_waveformatex(&self) -> Result<Self, WasapiError>
pub fn to_waveformatex(&self) -> Result<Self, WasapiError>
Return a copy in the simpler WAVEFORMATEX format.
Sourcepub fn as_waveformatex_ref(&self) -> &WAVEFORMATEX
pub fn as_waveformatex_ref(&self) -> &WAVEFORMATEX
get a reference of type &WAVEFORMATEX, used internally
Sourcepub fn get_blockalign(&self) -> u32
pub fn get_blockalign(&self) -> u32
Read nBlockAlign.
Sourcepub fn get_avgbytespersec(&self) -> u32
pub fn get_avgbytespersec(&self) -> u32
Read nAvgBytesPerSec.
Sourcepub fn get_bitspersample(&self) -> u16
pub fn get_bitspersample(&self) -> u16
Read wBitsPerSample.
Sourcepub fn get_validbitspersample(&self) -> u16
pub fn get_validbitspersample(&self) -> u16
Read wValidBitsPerSample.
Sourcepub fn get_samplespersec(&self) -> u32
pub fn get_samplespersec(&self) -> u32
Read nSamplesPerSec.
Sourcepub fn get_nchannels(&self) -> u16
pub fn get_nchannels(&self) -> u16
Read nChannels.
Sourcepub fn get_dwchannelmask(&self) -> u32
pub fn get_dwchannelmask(&self) -> u32
Read dwChannelMask.
Sourcepub fn get_subformat(&self) -> Result<SampleType, WasapiError>
pub fn get_subformat(&self) -> Result<SampleType, WasapiError>
Read SubFormat.
Trait Implementations§
Source§impl Clone for WaveFormat
impl Clone for WaveFormat
Source§fn clone(&self) -> WaveFormat
fn clone(&self) -> WaveFormat
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for WaveFormat
impl RefUnwindSafe for WaveFormat
impl Send for WaveFormat
impl Sync for WaveFormat
impl Unpin for WaveFormat
impl UnwindSafe for WaveFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more