def create_say(player): """Return a function say(words) for the given player, using the default EQ filter. """ lang = i18n.get_language_code() return functools.partial(say, player, eq_filter=create_eq_filter(), lang=lang)
def __init__(self, credentials_file): os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credentials_file credentials, _ = google.auth.default(scopes=[self.SCOPE]) super().__init__('speech.googleapis.com', credentials) self.language_code = i18n.get_language_code() if not hasattr(cloud_speech, 'StreamingRecognizeRequest'): raise ValueError("cloud_speech_pb2.py doesn't have StreamingRecognizeRequest.") self._transcript = None