fn do_rdc_calibration(&mut self) -> Result<Vec<i32>> {
        let mut zero_player: ZeroPlayer = Default::default();
        zero_player.start(Self::RDC_CALIB_WARM_UP_TIME)?;
        // Playback of zeros is started for Self::RDC_CALIB_WARM_UP_TIME, and the main thread
        // can start the calibration.
        self.set_spt_mode(SPTMode::OFF)?;
        self.set_calibration_mode(CalibMode::ON)?;
        // Playback of zeros is started, and the main thread can start the calibration.
        let mut avg_rdc = vec![0; self.setting.num_channels()];
        for _ in 0..Self::CALIB_REPEAT_TIMES {
            let rdc = self.get_adaptive_rdc()?;
            for i in 0..self.setting.num_channels() {
                avg_rdc[i] += rdc[i];
            }
            thread::sleep(Self::RDC_CALIB_INTERVAL);
        }
        self.set_spt_mode(SPTMode::ON)?;
        self.set_calibration_mode(CalibMode::OFF)?;
        zero_player.stop()?;

        avg_rdc = avg_rdc
            .iter()
            .map(|val| val / Self::CALIB_REPEAT_TIMES as i32)
            .collect();
        Ok(avg_rdc)
    }
/// Triggers the amplifier calibration and reads the calibrated rdc.
/// To get accurate calibration results, the main thread calibrates the amplifier while
/// the `zero_player` starts another thread to play zeros to the speakers.
Triggers the amplifier calibration and reads the calibrated rdc.
To get accurate calibration results, the main thread calibrates the amplifier while
the `zero_player` starts another thread to play zeros to the speakers.
Triggers the amplifier calibration and reads the calibrated rdc . To get accurate calibration results the main thread calibrates the amplifier while the ` zero_player ` starts another thread to play zeros to the speakers .
fn do_rdc_calibration(&mut self) -> Result<Vec<i32>> {
        let mut zero_player: ZeroPlayer = Default::default();
        zero_player.start(Self::RDC_CALIB_WARM_UP_TIME)?;
        // Playback of zeros is started for Self::RDC_CALIB_WARM_UP_TIME, and the main thread
        // can start the calibration.
        self.set_spt_mode(SPTMode::OFF)?;
        self.set_calibration_mode(CalibMode::ON)?;
        // Playback of zeros is started, and the main thread can start the calibration.
        let mut avg_rdc = vec![0; self.setting.num_channels()];
        for _ in 0..Self::CALIB_REPEAT_TIMES {
            let rdc = self.get_adaptive_rdc()?;
            for i in 0..self.setting.num_channels() {
                avg_rdc[i] += rdc[i];
            }
            thread::sleep(Self::RDC_CALIB_INTERVAL);
        }
        self.set_spt_mode(SPTMode::ON)?;
        self.set_calibration_mode(CalibMode::OFF)?;
        zero_player.stop()?;
        avg_rdc = avg_rdc
            .iter()
            .map(|val| val / Self::CALIB_REPEAT_TIMES as i32)
            .collect();
        Ok(avg_rdc)
    }
fn do_rdc_calibration ( & mut self ) -> Result < Vec < i32 > > { let mut zero_player : ZeroPlayer = Default :: default ( ) ; zero_player . start ( Self :: RDC_CALIB_WARM_UP_TIME ) ? ; // Playback of zeros is started for Self::RDC_CALIB_WARM_UP_TIME, and the main thread // can start the calibration. self . set_spt_mode ( SPTMode :: OFF ) ? ; self . set_calibration_mode ( CalibMode :: ON ) ? ; // Playback of zeros is started, and the main thread can start the calibration. let mut avg_rdc = vec ! [ 0 self setting num_channels ( ) ] ; for _ in 0 .. Self :: CALIB_REPEAT_TIMES { let rdc = self . get_adaptive_rdc ( ) ? ; for i in 0 .. self . setting . num_channels ( ) { avg_rdc [ i ] += rdc [ i ] ; } thread :: sleep ( Self :: RDC_CALIB_INTERVAL ) ; } self . set_spt_mode ( SPTMode :: ON ) ? ; self . set_calibration_mode ( CalibMode :: OFF ) ? ; zero_player . stop ( ) ? ; avg_rdc = avg_rdc . iter ( ) . map ( | val | val / Self :: CALIB_REPEAT_TIMES as i32 ) . collect ( ) ; Ok ( avg_rdc ) }
Triggers the amplifier calibration and reads the calibrated rdc.
Triggers the amplifier calibration and reads the calibrated rdc .
&mut self
&mut self