catch source is none error

This commit is contained in:
SevaSk 2023-06-01 14:59:36 -04:00
parent 1b958ad4e6
commit 29389e9ccb

View File

@ -11,6 +11,10 @@ class BaseRecorder:
self.recorder = sr.Recognizer() self.recorder = sr.Recognizer()
self.recorder.energy_threshold = ENERGY_THRESHOLD self.recorder.energy_threshold = ENERGY_THRESHOLD
self.recorder.dynamic_energy_threshold = DYNAMIC_ENERGY_THRESHOLD self.recorder.dynamic_energy_threshold = DYNAMIC_ENERGY_THRESHOLD
if source is None:
raise ValueError("audio source can't be None")
self.source = source self.source = source
self.source_name = source_name self.source_name = source_name