Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
Speech2Text.ipynb
transcribe.py

README.md

transcribe

transcribe.py is a Python command line script that translates audio to text using the Google Cloud Service Speech API.

Requires:

Usage

You can copy the transcribe.py file to a local directory and use it from there.

For basic use:

python transcribe.py gs://myBucketName/myAudioFile.flac

Command Line Arguments

positional arguments:
  gsc_uri             gcs_uri for audio file to be recognized
  apikey              File path for .json file with gcs api key

optional arguments:
  -h, --help          show this help message and exit
  -l, --language      Language of audio recording
  -c, --confidences   Optionally return json file with transcription confidence levels.

Examples

You can specify the language of the audio file to be translated. There are many options available.

python transcribe.py gs://myBucketName/SpanishAudio.wav -l es-ES

Options are available for many language dialects (indicated by the code in all caps).

python transcribe.py gs://myBucketName/MexicanSpanishAudio.wav -l es-MX

You can choose to write a second file to your current directory with the confidence levels for chunks of translation. Note that the script only returns the most likely translation.

python transcribe.py gs://myBucketName/EgyptianArabic.wav -l ar-EG

For more information on the script, check out this Speech2Text notebook.

You can’t perform that action at this time.