pub fn compute_frame_size(&self, channels: usize) -> Result<usize> {
        let bytes_per_channel = match self {
            AudioSampleFormat::Eight { .. } => 1,
            AudioSampleFormat::Sixteen { .. } => 2,
            AudioSampleFormat::TwentyFourPacked { .. } => 3,
            AudioSampleFormat::TwentyIn32 { .. }
            | AudioSampleFormat::TwentyFourIn32 { .. }
            | AudioSampleFormat::ThirtyTwo { .. }
            | AudioSampleFormat::Float { .. } => 4,
        };
        Ok(channels * bytes_per_channel)
    }
/// Compute the size of an audio frame based on the sample format.
/// Returns Err(OutOfRange) in the case where it cannot be computed
/// (bad channel count, bad sample format)
Compute the size of an audio frame based on the sample format.
Returns Err(OutOfRange) in the case where it cannot be computed
(bad channel count, bad sample format)
Compute the size of an audio frame based on the sample format . Returns Err ( OutOfRange ) in the case where it cannot be computed ( bad channel count bad sample format )
pub fn compute_frame_size(&self, channels: usize) -> Result<usize> {
        let bytes_per_channel = match self {
            AudioSampleFormat::Eight { .. } => 1,
            AudioSampleFormat::Sixteen { .. } => 2,
            AudioSampleFormat::TwentyFourPacked { .. } => 3,
            AudioSampleFormat::TwentyIn32 { .. }
            | AudioSampleFormat::TwentyFourIn32 { .. }
            | AudioSampleFormat::ThirtyTwo { .. }
            | AudioSampleFormat::Float { .. } => 4,
        };
        Ok(channels * bytes_per_channel)
    }
pub fn compute_frame_size ( & self , channels : usize ) -> Result < usize > { let bytes_per_channel = match self { AudioSampleFormat :: Eight { .. } => 1 , AudioSampleFormat :: Sixteen { .. } => 2 , AudioSampleFormat :: TwentyFourPacked { .. } => 3 , AudioSampleFormat :: TwentyIn32 { .. } | AudioSampleFormat :: TwentyFourIn32 { .. } | AudioSampleFormat :: ThirtyTwo { .. } | AudioSampleFormat :: Float { .. } => 4 , } ; Ok ( channels * bytes_per_channel ) }
Compute the size of an audio frame based on the sample format.
Compute the size of an audio frame based on the sample format .
&self
channels
usize
&self
channels
usize