#[repr(C)]pub struct AudioStreamBasicDescription {
pub mSampleRate: f64,
pub mFormatID: u32,
pub mFormatFlags: u32,
pub mBytesPerPacket: u32,
pub mFramesPerPacket: u32,
pub mBytesPerFrame: u32,
pub mChannelsPerFrame: u32,
pub mBitsPerChannel: u32,
pub mReserved: u32,
}
Expand description
This structure encapsulates all the information for describing the basic format properties of a stream of audio data.
This structure is sufficient to describe any constant bit rate format that has channels that are the same size. Extensions are required for variable bit rate data and for constant bit rate data where the channels have unequal sizes. However, where applicable, the appropriate fields will be filled out correctly for these kinds of formats (the extra data is provided via separate properties). In all fields, a value of 0 indicates that the field is either unknown, not applicable or otherwise is inapproprate for the format and should be ignored. Note that 0 is still a valid value for most formats in the mFormatFlags field.
In audio data a frame is one sample across all channels. In non-interleaved audio, the per frame fields identify one channel. In interleaved audio, the per frame fields identify the set of n channels. In uncompressed audio, a Packet is one frame, (mFramesPerPacket == 1). In compressed audio, a Packet is an indivisible chunk of compressed data, for example an AAC packet will contain 1024 sample frames.
The number of sample frames per second of the data in the stream.
The AudioFormatID indicating the general kind of data in the stream.
The AudioFormatFlags for the format indicated by mFormatID.
The number of bytes in a packet of data.
The number of sample frames in each packet of data.
The number of bytes in a single sample frame of data.
The number of channels in each frame of data.
The number of bits of sample data for each channel in a frame of data.
Pads the structure out to force an even 8 byte alignment.
See also Apple’s documentation
Fields§
§mSampleRate: f64
§mFormatID: u32
§mFormatFlags: u32
§mBytesPerPacket: u32
§mFramesPerPacket: u32
§mBytesPerFrame: u32
§mChannelsPerFrame: u32
§mBitsPerChannel: u32
§mReserved: u32
Trait Implementations§
Source§impl Clone for AudioStreamBasicDescription
impl Clone for AudioStreamBasicDescription
Source§fn clone(&self) -> AudioStreamBasicDescription
fn clone(&self) -> AudioStreamBasicDescription
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more