mirror of
https://github.com/SevaSk/ecoute.git
synced 2024-12-19 12:47:53 +00:00
catch source is none error
This commit is contained in:
parent
1b958ad4e6
commit
29389e9ccb
@ -11,6 +11,10 @@ class BaseRecorder:
|
||||
self.recorder = sr.Recognizer()
|
||||
self.recorder.energy_threshold = 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_name = source_name
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user