SoundCalibration

class SoundCalibration(speaker: int, gain: float, sound_index: int, duration: float)[source]

Bases: object

Class to handle sound calibration procedures.

__init__(speaker: int, gain: float, sound_index: int, duration: float) None[source]

Initializes the SoundCalibration instance.

Parameters:
  • speaker (int) – The speaker ID to calibrate (0 or 1).

  • gain (float) – The gain value to test.

  • sound_index (int) – Index of the sound function in the manager.

  • duration (float) – Duration of the calibration sound.

Methods

__init__(speaker, gain, sound_index, duration)

Initializes the SoundCalibration instance.

close()

Closes the calibration instance and releases resources.

run()

Executes the sound calibration process.

run_in_thread([daemon])

Runs the calibration process in a separate thread.

run() None[source]

Executes the sound calibration process.

Generates sound, loads it to the specified speaker, plays it, and handles errors.

run_in_thread(daemon: bool = True) None[source]

Runs the calibration process in a separate thread.

Parameters:

daemon (bool, optional) – Whether to run as a daemon thread. Defaults to True.

close() None[source]

Closes the calibration instance and releases resources.