7d47747b0515a1f0c4b3ae7bc999b072c132864a,media-translation/cloud-client/translate_from_mic.py,,main,#,122
Before Change
first_request = mediatranslation.StreamingTranslateSpeechRequest(
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)
requests = itertools.chain(iter([first_request]), mic_requests)
responses = client.streaming_translate_speech(requests)
// Print the translation responses as they arrive
listen_print_loop(responses)
if __name__ == "__main__":
print("Start speaking ...")
main()
// [END media_translation_translate_from_mic]
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__":
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7d47747b0515a1f0c4b3ae7bc999b072c132864a
Time: 2020-06-15
Author: erschmid@google.com
File Name: media-translation/cloud-client/translate_from_mic.py
Class Name:
Method Name: main
Project Name: comic/grand-challenge.org
Commit Name: b96135c218065188be9dfe1fea1dff76b6f66e4f
Time: 2019-02-26
Author: code@jmsmkn.com
File Name: app/grandchallenge/container_exec/tasks.py
Class Name:
Method Name: validate_docker_image_async
Project Name: cve-search/cve-search
Commit Name: 0f2d4db89845b9fe748bb8df19c166ebc937c930
Time: 2020-08-11
Author: paul.tikken@gmail.com
File Name: sbin/db_mgmt_cpe_dictionary.py
Class Name: CPEDownloads
Method Name: download_site
Project Name: cve-search/cve-search
Commit Name: 0f2d4db89845b9fe748bb8df19c166ebc937c930
Time: 2020-08-11
Author: paul.tikken@gmail.com
File Name: sbin/db_mgmt_json.py
Class Name: CVEDownloads
Method Name: download_site