fn extract_samples(&mut self) {
        let mut working_buffer = self.working_buffer.take().unwrap();
        working_buffer.extract_samples(&self.audio_buffer);

        // swap buffers
        {
            let exposed_buffer_box = &mut *self.exposed_buffer_mtx.lock().unwrap();
            // get latest state from the previously exposed buffer
            // in order to smoothen rendering between frames
            working_buffer.update_concrete_state(exposed_buffer_box.as_mut());
            mem::swap(exposed_buffer_box, &mut working_buffer);
        }

        self.lower_to_keep = working_buffer.get_lower();
        self.sample_window = working_buffer
            .get_requested_sample_window()
            .map(|req_sample_window| req_sample_window.min(self.max_sample_window));

        self.working_buffer = Some(working_buffer);
        // self.working_buffer is now the buffer previously in
        // self.exposed_buffer_mtx
    }
// Update the working extractor with new samples and swap.
Update the working extractor with new samples and swap.
Update the working extractor with new samples and swap .
fn extract_samples(&mut self) {
        let mut working_buffer = self.working_buffer.take().unwrap();
        working_buffer.extract_samples(&self.audio_buffer);
        // swap buffers
        {
            let exposed_buffer_box = &mut *self.exposed_buffer_mtx.lock().unwrap();
            // get latest state from the previously exposed buffer
            // in order to smoothen rendering between frames
            working_buffer.update_concrete_state(exposed_buffer_box.as_mut());
            mem::swap(exposed_buffer_box, &mut working_buffer);
        }
        self.lower_to_keep = working_buffer.get_lower();
        self.sample_window = working_buffer
            .get_requested_sample_window()
            .map(|req_sample_window| req_sample_window.min(self.max_sample_window));
        self.working_buffer = Some(working_buffer);
        // self.working_buffer is now the buffer previously in
        // self.exposed_buffer_mtx
    }
fn extract_samples ( & mut self ) { let mut working_buffer = self . working_buffer . take ( ) . unwrap ( ) ; working_buffer . extract_samples ( & self . audio_buffer ) ; // swap buffers { let exposed_buffer_box = & mut * self . exposed_buffer_mtx . lock ( ) . unwrap ( ) ; // get latest state from the previously exposed buffer // in order to smoothen rendering between frames working_buffer . update_concrete_state ( exposed_buffer_box . as_mut ( ) ) ; mem :: swap ( exposed_buffer_box , & mut working_buffer ) ; } self . lower_to_keep = working_buffer . get_lower ( ) ; self . sample_window = working_buffer . get_requested_sample_window ( ) . map ( | req_sample_window | req_sample_window . min ( self . max_sample_window ) ) ; self . working_buffer = Some ( working_buffer ) ; // self.working_buffer is now the buffer previously in // self.exposed_buffer_mtx }
Update the working extractor with new samples and swap.
Update the working extractor with new samples and swap .
&mut self
&mut self