streaming_config=config, audio_content=None)
with MicrophoneStream(RATE, CHUNK) as stream:
audio_generator = stream.generator()
mic_requests = (mediatranslation.StreamingTranslateSpeechRequest(
audio_content=content,
streaming_config=config)
for content in audio_generator)
After Change
print()
option = input("Press any key to translate or \"q\" to quit: ")
if option.lower() == "q":
break
do_translation_loop()
if __name__ == "__main__":