Skip to content

Commit

Permalink
catch source is none error
Browse files Browse the repository at this point in the history
  • Loading branch information
SevaSk committed Jun 1, 2023
1 parent 1b958ad commit 29389e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AudioRecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def __init__(self, source, source_name):
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

Expand Down

0 comments on commit 29389e9

Please sign in to comment.