Skip to content

Latest commit

 

History

History
140 lines (99 loc) · 5.04 KB

speech.rst

File metadata and controls

140 lines (99 loc) · 5.04 KB

Google Cloud Text to Speech Operators

Prerequisite Tasks

GcpTextToSpeechSynthesizeOperator

Synthesizes text to audio file and stores it to Google Cloud Storage

For parameter definition, take a look at airflow.contrib.operators.gcp_text_to_speech_operator.GcpTextToSpeechSynthesizeOperator

Arguments

Some arguments in the example DAG are taken from the OS environment variables:

../../../../airflow/contrib/example_dags/example_gcp_speech.py

input, voice and audio_config arguments need to be dicts or objects of corresponding classes from google.cloud.texttospeech_v1.types module

for more information, see: https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/api.html#google.cloud.texttospeech_v1.TextToSpeechClient.synthesize_speech

../../../../airflow/contrib/example_dags/example_gcp_speech.py

filename is a simple string argument:

../../../../airflow/contrib/example_dags/example_gcp_speech.py

Using the operator

../../../../airflow/contrib/example_dags/example_gcp_speech.py

Templating

../../../../airflow/contrib/operators/gcp_text_to_speech_operator.py

Google Cloud Speech to Text Operators

GcpSpeechToTextRecognizeSpeechOperator

Recognizes speech in audio input and returns text.

For parameter definition, take a look at airflow.contrib.operators.gcp_speech_to_text_operator.GcpSpeechToTextRecognizeSpeechOperator

Arguments

config and audio arguments need to be dicts or objects of corresponding classes from google.cloud.speech_v1.types module

for more information, see: https://googleapis.github.io/google-cloud-python/latest/speech/gapic/v1/api.html#google.cloud.speech_v1.SpeechClient.recognize

../../../../airflow/contrib/example_dags/example_gcp_speech.py

filename is a simple string argument:

../../../../airflow/contrib/example_dags/example_gcp_speech.py

Using the operator

../../../../airflow/contrib/example_dags/example_gcp_speech.py

Templating

../../../../airflow/contrib/operators/gcp_speech_to_text_operator.py

Reference

For further information, look at: