Skip to content

Instantly share code, notes, and snippets.

@michelbl
Created December 9, 2021 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michelbl/9b192ef5bcfafc80280487442dc279d4 to your computer and use it in GitHub Desktop.
Save michelbl/9b192ef5bcfafc80280487442dc279d4 to your computer and use it in GitHub Desktop.
from google.cloud import speech
client = speech.SpeechClient()
audio = speech.RecognitionAudio(uri="gs://speech-data-895/source_2_flac.wav")
config = speech.RecognitionConfig(
language_code="fr-FR",
)
response = client.long_running_recognize(
config=config,
audio=audio,
)
for result in response.results:
print("Transcript: {}".format(result.alternatives[0].transcript))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment