verify_dependencies(["sr"])
if username is None or password is None:
try:
username = os.environ["IBM_USERNAME"]
password = os.environ["IBM_PASSWORD"]
except KeyError:
raise ValueError("A valid API key must be passed when a "
"SpeechRecognitionConverter is initialized.")
self.recognizer = sr.Recognizer()
self.username = username
self.password = password
self.resolution = resolution
super(IBMSpeechAPIConverter, self).__init__()
After Change
except KeyError:
raise ValueError("A valid API key must be passed when a "
"SpeechRecognitionConverter is initialized.")
self.recognizer = sr.Recognizer()
self.username = username
self.password = password
self.resolution = resolution
super(IBMSpeechAPIConverter, self).__init__(rate_limit=rate_limit)