pub fn copy_interleaved_typed<F>(&mut self, src: &AudioBuffer<F>)
    where
        F: Sample + IntoSample<S>,
    {
        let n_channels = src.spec.channels.count();
        let n_samples = src.frames() * n_channels;

        // Ensure that the capacity of the sample buffer is greater than or equal to the number
        // of samples that will be copied from the source buffer.
        assert!(self.capacity() >= n_samples);

        // Interleave the source buffer channels into the sample buffer.
        for ch in 0..n_channels {
            let ch_slice = src.chan(ch);

            for (dst, src) in self.buf[ch..].iter_mut().step_by(n_channels).zip(ch_slice) {
                *dst = (*src).into_sample();
            }
        }

        // Commit the written samples.
        self.n_written = n_samples;
    }
/// Copies all audio samples from a source `AudioBuffer` into the `SampleBuffer` in interleaved
/// channel order. The two buffers must be equivalent.
Copies all audio samples from a source `AudioBuffer` into the `SampleBuffer` in interleaved
channel order. The two buffers must be equivalent.
Copies all audio samples from a source ` AudioBuffer ` into the ` SampleBuffer ` in interleaved channel order . The two buffers must be equivalent .
pub fn copy_interleaved_typed<F>(&mut self, src: &AudioBuffer<F>)
    where
        F: Sample + IntoSample<S>,
    {
        let n_channels = src.spec.channels.count();
        let n_samples = src.frames() * n_channels;
        // Ensure that the capacity of the sample buffer is greater than or equal to the number
        // of samples that will be copied from the source buffer.
        assert!(self.capacity() >= n_samples);
        // Interleave the source buffer channels into the sample buffer.
        for ch in 0..n_channels {
            let ch_slice = src.chan(ch);
            for (dst, src) in self.buf[ch..].iter_mut().step_by(n_channels).zip(ch_slice) {
                *dst = (*src).into_sample();
            }
        }
        // Commit the written samples.
        self.n_written = n_samples;
    }
pub fn copy_interleaved_typed < F > ( & mut self , src : & AudioBuffer < F > ) where F : Sample + IntoSample < S > , { let n_channels = src . spec . channels . count ( ) ; let n_samples = src . frames ( ) * n_channels ; // Ensure that the capacity of the sample buffer is greater than or equal to the number // of samples that will be copied from the source buffer. assert ! ( self capacity ( ) n_samples ) ; // Interleave the source buffer channels into the sample buffer. for ch in 0 .. n_channels { let ch_slice = src . chan ( ch ) ; for ( dst , src ) in self . buf [ ch .. ] . iter_mut ( ) . step_by ( n_channels ) . zip ( ch_slice ) { * dst = ( * src ) . into_sample ( ) ; } } // Commit the written samples. self . n_written = n_samples ; }
Copies all audio samples from a source `AudioBuffer` into the `SampleBuffer` in interleaved
channel order.
Copies all audio samples from a source ` AudioBuffer ` into the ` SampleBuffer ` in interleaved channel order .
&mut self
src
&AudioBuffer<F>
&mut self
src
&AudioBuffer<F>