diff --git a/speech_recognition/__init__.py b/speech_recognition/__init__.py index 022cd7d5..2ea5fc80 100644 --- a/speech_recognition/__init__.py +++ b/speech_recognition/__init__.py @@ -324,11 +324,11 @@ def read(self, size=-1): class Recognizer(AudioSource): - def __init__(self): + def __init__(self, energy_threshold=300): """ Creates a new ``Recognizer`` instance, which represents a collection of speech recognition functionality. """ - self.energy_threshold = 300 # minimum audio energy to consider for recording + self.energy_threshold = energy_threshold # minimum audio energy to consider for recording self.dynamic_energy_threshold = True self.dynamic_energy_adjustment_damping = 0.15 self.dynamic_energy_ratio = 1.5