airflow.contrib.hooks.gcp_text_to_speech_hook¶
Module Contents¶
- 
class airflow.contrib.hooks.gcp_text_to_speech_hook.GCPTextToSpeechHook(gcp_conn_id='google_cloud_default', delegate_to=None)[source]¶
- Bases: - airflow.contrib.hooks.gcp_api_base_hook.GoogleCloudBaseHook- Hook for Google Cloud Text to Speech API. - Parameters
 - 
get_conn(self)[source]¶
- Retrieves connection to Cloud Text to Speech. - Returns
- Google Cloud Text to Speech client object. 
- Return type
 
 - 
synthesize_speech(self, input_data, voice, audio_config, retry=None, timeout=None)[source]¶
- Synthesizes text input - Parameters
- input_data (dict or google.cloud.texttospeech_v1.types.SynthesisInput) – text input to be synthesized. See more: https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.SynthesisInput 
- voice (dict or google.cloud.texttospeech_v1.types.VoiceSelectionParams) – configuration of voice to be used in synthesis. See more: https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.VoiceSelectionParams 
- audio_config (dict or google.cloud.texttospeech_v1.types.AudioConfig) – configuration of the synthesized audio. See more: https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.AudioConfig 
- retry (google.api_core.retry.Retry) – (Optional) A retry object used to retry requests. If None is specified, requests will not be retried. 
- timeout (float) – (Optional) The amount of time, in seconds, to wait for the request to complete. Note that if retry is specified, the timeout applies to each individual attempt. 
 
- Returns
- SynthesizeSpeechResponse See more: https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.SynthesizeSpeechResponse 
- Return type