### Install Text-to-Speech Library on Windows Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest Installs the google-cloud-texttospeech library in a virtual environment on Windows systems. Ensure you have Python and venv installed. ```powershell py -m venv .\\Scripts\activate pip install google-cloud-texttospeech ``` -------------------------------- ### Install Text-to-Speech Library on Mac/Linux Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest Installs the google-cloud-texttospeech library in a virtual environment on Mac or Linux systems. Ensure you have Python 3 and venv installed. ```bash python3 -m venv source /bin/activate pip install google-cloud-texttospeech ``` -------------------------------- ### get_operation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Gets the latest state of a long-running operation. Clients can use this method to query the status of an operation previously started by other methods. ```APIDOC ## Method: get_operation ### Description Gets the latest state of a long-running operation. Clients can use this method to query the status of an operation previously started by other methods. ### Method `get_operation` ``` -------------------------------- ### Create client from service account file Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Creates an instance of the client using credentials from a service account JSON file. Pass the path to the file as the 'filename' argument. ```python from_service_account_file(filename: str, *args, **kwargs) ``` -------------------------------- ### Instantiate Text-to-Speech Client Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Initializes a new Text-to-Speech client. You can provide credentials, specify a transport layer, and configure client options. ```python TextToSpeechClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = None, client_options: typing.Optional[ typing.Union[google.api_core.client_options.ClientOptions, dict] ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### Japanese Pitch Accent Example Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.types.CustomPronunciationParams.PhoneticEncoding Demonstrates the use of pitch accents in Japanese pronunciation using `^` for pitch phrase start and `!` for down-pitch position. Supports Tokyo dialect with at most one down-pitch per phrase. ```text phrase:端 pronunciation:^はし phrase:箸 pronunciation:^は!し phrase:橋 pronunciation:^はし! ``` -------------------------------- ### Create Client from Service Account Info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient Creates an instance of the TextToSpeechAsyncClient using provided service account credentials information. The info dictionary should contain the necessary key details. ```python from_service_account_info(info: dict, *args, **kwargs) ``` -------------------------------- ### Create Client from Service Account File Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient Creates an instance of the TextToSpeechAsyncClient using credentials from a service account JSON file. Ensure the file path is correct. ```python from_service_account_file(filename: str, *args, **kwargs) ``` -------------------------------- ### TextToSpeechLongAudioSynthesizeAsyncClient.get_operation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Gets the latest state of a long-running operation. Gets the latest state of a long-running operation. ```APIDOC ## TextToSpeechLongAudioSynthesizeAsyncClient.get_operation ### Description Gets the latest state of a long-running operation. Gets the latest state of a long-running operation. ### Method Not specified (assumed to be a client method call) ### Endpoint Not specified ### Parameters Not specified ### Request Example ```python client.get_operation(name) ``` ### Response Not specified ``` -------------------------------- ### Create Client from Service Account Info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Instantiate the TextToSpeechLongAudioSynthesizeAsyncClient using provided service account credentials information. ```python from_service_account_info(info: dict, *args, **kwargs) ``` -------------------------------- ### get_operation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechAsyncClient.html Gets an operation that has been completed. ```APIDOC ## get_operation ### Description Gets an operation that has been completed. ### Parameters * **name** (str): The name of the operation. ### Returns * **Operation**: The operation. ``` -------------------------------- ### Create Client from Service Account JSON File Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Instantiate the TextToSpeechLongAudioSynthesizeAsyncClient using a service account private key JSON file. ```python from_service_account_json(filename: str, *args, **kwargs) ``` -------------------------------- ### MultiSpeakerVoiceConfig Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types Configuration for a multi-speaker text-to-speech setup. ```APIDOC ## MultiSpeakerVoiceConfig ### Description Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request. ``` -------------------------------- ### MultispeakerPrebuiltVoice Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types Configuration for a single speaker in a Gemini TTS multi-speaker setup. ```APIDOC ## MultispeakerPrebuiltVoice ### Description Configuration for a single speaker in a Gemini TTS multi-speaker setup. Enables dialogue between two speakers. ``` -------------------------------- ### Create Client from Service Account File Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Creates an instance of TextToSpeechAsyncClient using the provided service account credentials file. ```APIDOC ### from_service_account_file ``` from_service_account_file(filename: str, *args, **kwargs) ``` Creates an instance of this client using the provided credentials file. **Parameter** * **filename** (`str`): The path to the service account private key json file. **Returns** * **TextToSpeechAsyncClient**: The constructed client. ``` -------------------------------- ### TextToSpeechAsyncClient.get_operation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Gets the latest state of a long-running operation. This method is part of the v1beta1 client. ```APIDOC ## get_operation ### Description Retrieves the status of a long-running operation. ### Method GET ### Endpoint /v1beta1/{name=operations/*} ### Parameters #### Path Parameters - **name** (string) - Required - The name of the operation resource. ### Response #### Success Response (200) - **name** (string) - The name of the operation. - **done** (boolean) - Indicates if the operation is complete. - **response** (object) - The normal response of the operation if it is done. - **error** (object) - The error result of the operation if it is done. #### Response Example ```json { "name": "operations/some-operation-id", "done": false } ``` ``` -------------------------------- ### Instantiate TextToSpeechAsyncClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Instantiates the text to speech async client. Use this to create a client instance for asynchronous operations. ```python TextToSpeechAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechAsyncClient.get_operation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Gets the latest state of a long-running operation. Clients can use this method to query the status of an operation. ```APIDOC ## get_operation ### Description Gets the latest state of a long-running operation. Clients can use this method to query the status of an operation. ### Method (Not specified in source) ### Endpoint (Not specified in source) ### Parameters (Not specified in source) ### Request Example (Not specified in source) ### Response #### Success Response (200) (Not specified in source) #### Response Example (Not specified in source) ``` -------------------------------- ### TextToSpeechClient Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechClient.html Initializes a TextToSpeechClient instance. Configure with credentials, transport, client options, and client info. ```python TextToSpeechClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = None, client_options: typing.Optional[ typing.Union[google.api_core.client_options.ClientOptions, dict] ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### Get Transport Class Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Returns the appropriate transport class for the client. A specific transport can be requested by its label. ```python get_transport_class( label: typing.Optional[str] = None, ) -> typing.Type[ google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.transports.base.TextToSpeechLongAudioSynthesizeTransport ] ``` -------------------------------- ### MultispeakerPrebuiltVoice Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.types Configuration for a single speaker in a Gemini TTS multi-speaker setup. Enables dialogue between two speakers. ```APIDOC ## Class: MultispeakerPrebuiltVoice ### Description Configuration for a single speaker in a Gemini TTS multi-speaker setup. Enables dialogue between two speakers. ``` -------------------------------- ### from_service_account_info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.html Creates an instance of the client using provided credentials info. ```APIDOC ## from_service_account_info Creates an instance of this client using the provided credentials info. ### Parameters - **info** (dict) - Required - The service account private key info. ### Returns - **TextToSpeechLongAudioSynthesizeAsyncClient** - The constructed client. ``` -------------------------------- ### TextToSpeechAsyncClient Initialization Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Instantiates the TextToSpeechAsyncClient. You can provide credentials, specify a transport, and customize client options. ```APIDOC ## TextToSpeechAsyncClient Instantiates the text to speech async client. ### Parameters * **credentials** (`Optional[google.auth.credentials.Credentials]`): Authorization credentials. If none are specified, the client will attempt to ascertain credentials from the environment. * **transport** (`Optional[Union[str, TextToSpeechTransport, Callable[..., TextToSpeechTransport]]]`): The transport to use, or a Callable that constructs and returns a new transport. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state. * **client_options** (`Optional[Union[google.api_core.client_options.ClientOptions, dict]]`): Custom options for the client, such as `api_endpoint` or `universe_domain`. * **client_info** (`google.api_core.gapic_v1.client_info.ClientInfo`): Client info used to send a user-agent string along with API requests. ### Exceptions * **google.auth.exceptions.MutualTlsChannelError**: If mutual TLS transport creation failed. ``` -------------------------------- ### MultiSpeakerVoiceConfig Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.types Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request. ```APIDOC ## Class: MultiSpeakerVoiceConfig ### Description Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request. ``` -------------------------------- ### from_service_account_file Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.html Creates an instance of this client using the provided credentials file. ```APIDOC ## from_service_account_file ### Description Creates an instance of this client using the provided credentials file. ### Parameters - **filename** (str) - The path to the service account private key json file. ### Returns - **TextToSpeechLongAudioSynthesizeAsyncClient** - The constructed client. ``` -------------------------------- ### Get Long-Running Operation Status Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Fetches the latest status of a long-running operation using its request object. Supports custom retry and timeout configurations. ```python get_operation( request: typing.Optional[ typing.Union[google.longrunning.operations_pb2.GetOperationRequest, dict] ] = None, *, retry: typing.Optional[ typing.Union[ google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault, ] ] = _MethodDefault._DEFAULT_VALUE, timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = () ) -> google.longrunning.operations_pb2.Operation ``` -------------------------------- ### PhoneticEncoding Class Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types.CustomPronunciationParams.PhoneticEncoding The PhoneticEncoding class represents the phonetic encoding of a phrase. It can include pitch accents, specified with '^' for the start of a pitch phrase and '!' for the down-pitch position. ```APIDOC ## Class PhoneticEncoding The phonetic encoding of the phrase. ### Usage Example ```python # Example of using pitch accents phrase: "端" pronunciation: "^はし" phrase: "箸" pronunciation: "^は!し" phrase: "橋" pronunciation: "^はし!" ``` ### Supported Dialect Currently only the Tokyo dialect is supported, which allows at most one down-pitch per phrase (i.e. at most one `!` between `^`). ### Phonetic Encoding Types * **PHONETIC_ENCODING_PINYIN**: Used to specify pronunciations for Mandarin words. For example, "朝阳" has the pronunciation "chao2 yang2". The number represents the tone, and there is a space between syllables. Neutral tones are represented by 5, for example "孩子" "hai2 zi5". * **PHONETIC_ENCODING_UNSPECIFIED**: Not specified. * **PHONETIC_ENCODING_IPA**: IPA, such as apple -> `ˈæpəl`. https://en.wikipedia.org/wiki/International_Phonetic_Alphabet * **PHONETIC_ENCODING_X_SAMPA**: X-SAMPA, such as apple -> "{p@l". https://en.wikipedia.org/wiki/X-SAMPA * **PHONETIC_ENCODING_JAPANESE_YOMIGANA**: For reading-to-pronunciation conversion to work well, the `pronunciation` field should only contain Kanji, Hiragana, and Katakana. ``` -------------------------------- ### SynthesisInput Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types.SynthesisInput.html Initializes a SynthesisInput object. Either 'text' or 'ssml' must be provided. ```python SynthesisInput(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### Get mTLS Endpoint and Certificate Source Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Retrieves the API endpoint and client certificate source for mutual TLS. Configuration is determined by environment variables and client options. ```python get_mtls_endpoint_and_cert_source( client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, ) ``` -------------------------------- ### TextToSpeechAsyncClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Initializes a new instance of the TextToSpeechAsyncClient class. Args: credentials: Optional. Credentials to use for this client. If not specified, the client will attempt to determine credentials from the environment. transport: Optional. The transport to use for the API. Can be a string ('grpc_asyncio') or a transport class. client_options: Optional. Client options for the API. client_info: Optional. Client information for the API. ```APIDOC ```python TextToSpeechAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` ``` -------------------------------- ### Mandarin Pinyin Pronunciation Example Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.types.CustomPronunciationParams.PhoneticEncoding Specifies pronunciations for Mandarin words using Pinyin. Tones are represented by numbers (1-5), with 5 for neutral tones. Syllables are space-separated. ```text 朝阳, the pronunciation is "chao2 yang2". The number represents the tone, and there is a space between syllables. Neutral tones are represented by 5, for example 孩子 "hai2 zi5". ``` -------------------------------- ### Initialize TextToSpeechAsyncClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Instantiates the asynchronous client for the Text-to-Speech API. Configure transport, credentials, and client options during initialization. ```python TextToSpeechAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### VoiceSelectionParams Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types.VoiceSelectionParams.html Instantiate VoiceSelectionParams to configure voice selection for synthesis requests. Use language_code, name, ssml_gender, custom_voice, voice_clone, or model_name to guide voice selection. ```python VoiceSelectionParams(mapping=None, *, ignore_unknown_fields=False, **kwargs) ``` -------------------------------- ### TextToSpeechClient Initialization Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechClient.html Instantiates the TextToSpeechClient. This client can be initialized with credentials, transport options, client options, and client information. ```APIDOC ## TextToSpeechClient Instantiates the text to speech client. ### Parameters * **credentials** (`Optional[google.auth.credentials.Credentials]`): The authorization credentials to attach to requests. If none are specified, the client will attempt to ascertain the credentials from the environment. * **transport** (`Optional[Union[str, TextToSpeechTransport, Callable[..., TextToSpeechTransport]]]`): The transport to use, or a Callable that constructs and returns a new transport. If a Callable is given, it will be called with the same set of initialization arguments as used in the TextToSpeechTransport constructor. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state (preview). * **client_options** (`Optional[Union[google.api_core.client_options.ClientOptions, dict]]`): Custom options for the client. This can include overriding the default API endpoint, providing a client certificate for mTLS transport, or overriding the universe domain. * **client_info** (`google.api_core.gapic_v1.client_info.ClientInfo`): The client info used to send a user-agent string along with API requests. If `None`, then default info will be used. ### Exceptions * **google.auth.exceptions.MutualTLSChannelError**: If mutual TLS transport creation failed for any reason. ``` -------------------------------- ### from_service_account_file Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Creates an instance of this client using the provided credentials file. See more: google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.from_service_account_file ```APIDOC ## from_service_account_file ### Description Creates an instance of this client using the provided credentials file. ### Parameters * **filename** (str) - The path to the service account credentials file. * **args** - Positional arguments. * **kwargs** - Keyword arguments. ### Returns (TextToSpeechLongAudioSynthesizeAsyncClient) - An instance of the client. ``` -------------------------------- ### Pinyin Pronunciation for Mandarin Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types.CustomPronunciationParams.PhoneticEncoding Specifies pronunciations for Mandarin words using Pinyin, including tone numbers and neutral tones. For example, 'chao2 yang2' for '朝阳' and 'hai2 zi5' for '孩子'. ```text PHONETIC_ENCODING_PINYIN (4): Used to specify pronunciations for Mandarin words. See https://en.wikipedia.org/wiki/Pinyin. For example: 朝阳, the pronunciation is "chao2 yang2". The number represents the tone, and there is a space between syllables. Neutral tones are represented by 5, for example 孩子 "hai2 zi5". ``` -------------------------------- ### TextToSpeechClient.from_service_account_json Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Creates an instance of this client using the provided credentials file. This is an alias for `from_service_account_file`. ```APIDOC ## from_service_account_json(filename: str, *args, **kwargs) ### Description Creates an instance of this client using the provided credentials file. ### Parameters - **filename** (str) - Required - The path to the service account key file. - **args**: Additional positional arguments. - **kwargs**: Additional keyword arguments. ``` -------------------------------- ### Pitch Accents in Japanese Pronunciation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.types.CustomPronunciationParams.PhoneticEncoding Demonstrates the use of pitch accents in Japanese pronunciation using `^` for phrase start and `!` for down-pitch positions. Supports Tokyo dialect with at most one down-pitch per phrase. ```text phrase:端 pronunciation:^はし phrase:箸 pronunciation:^は!し phrase:橋 pronunciation:^はし! ``` -------------------------------- ### Configure Handler for All Google Loggers (Code) Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest Configure a handler for all Google-based loggers using Python's standard logging mechanism. This involves getting the base logger and adding a StreamHandler with DEBUG level. ```python import logging from google.cloud import library_v1 base_logger = logging.getLogger("google") base_logger.addHandler(logging.StreamHandler()) base_logger.setLevel(logging.DEBUG) ``` -------------------------------- ### TextToSpeechClient from_service_account_file Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechClient.html Creates an instance of the TextToSpeechClient using the provided credentials file. ```APIDOC ### from_service_account_file ```python from_service_account_file(filename: str, *args, **kwargs) ``` Creates an instance of this client using the provided credentials file. **Parameter** * **filename** (`str`): The path to the service account private key json file. **Returns** * `TextToSpeechClient`: The constructed client. ``` -------------------------------- ### from_service_account_json Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.html Creates an instance of the client using a provided credentials file. ```APIDOC ## from_service_account_json Creates an instance of this client using the provided credentials file. ### Parameters - **filename** (str) - Required - The path to the service account private key json file. ### Returns - **TextToSpeechLongAudioSynthesizeAsyncClient** - The constructed client. ``` -------------------------------- ### Synthesize Speech Synchronously Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient Use this method to synthesize speech synchronously, receiving results after all text input has been processed. This example requires modifications for correct values and may need regional endpoints specified. ```python from google.cloud import texttospeech_v1 async def sample_synthesize_speech(): # Create a client client = texttospeech_v1.TextToSpeechAsyncClient() # Initialize request argument(s) input = texttospeech_v1.SynthesisInput() input.text = "text_value" voice = texttospeech_v1.VoiceSelectionParams() voice.language_code = "language_code_value" audio_config = texttospeech_v1.AudioConfig() audio_config.audio_encoding = "M4A" request = texttospeech_v1.SynthesizeSpeechRequest( input=input, voice=voice, audio_config=audio_config, ) # Make the request response = await client.synthesize_speech(request=request) # Handle the response print(response) ``` -------------------------------- ### get_operation Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechClient.html Gets the latest state of a long-running operation. Clients can use this method to query the status of an operation returned by another API method like CreateSynthesizeTask. If the operation is not yet completed, subsequent GetOperation requests should be made. If the operation has completed, the response will contain the operation's result or error information. ```APIDOC ## Methods ### get_operation Gets the latest state of a long-running operation. ``` -------------------------------- ### from_service_account_json Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient Creates an instance of the Text-to-Speech client using a service account JSON key file. ```APIDOC ## from_service_account_json Creates an instance of this client using the provided credentials file. ### Parameters - **filename** (str) - Required - The path to the service account private key json file. ### Returns - **TextToSpeechAsyncClient** - The constructed client. ``` -------------------------------- ### Create Client from Service Account Info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Creates an instance of TextToSpeechAsyncClient using the provided service account credentials information. ```APIDOC ### from_service_account_info ``` from_service_account_info(info: dict, *args, **kwargs) ``` Creates an instance of this client using the provided credentials info. **Parameter** * **info** (`dict`): The service account private key info. **Returns** * **TextToSpeechAsyncClient**: The constructed client. ``` -------------------------------- ### from_service_account_info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Creates an instance of this client using the provided credentials info. See more: google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.from_service_account_info ```APIDOC ## from_service_account_info ### Description Creates an instance of this client using the provided credentials info. ### Parameters * **info** (dict) - The service account credentials info. * **args** - Positional arguments. * **kwargs** - Keyword arguments. ### Returns (TextToSpeechLongAudioSynthesizeAsyncClient) - An instance of the client. ``` -------------------------------- ### TextToSpeechAsyncClient Initialization Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Initializes the TextToSpeechAsyncClient. You can optionally provide credentials, a transport layer, client options, and client information. ```python TextToSpeechAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### from_service_account_json Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Creates an instance of the TextToSpeechAsyncClient using a service account JSON key file. ```APIDOC ## from_service_account_json ### Description Creates an instance of this client using the provided credentials file. ### Parameters * `filename` (str) - The path to the service account private key json file. ### Returns * `TextToSpeechAsyncClient` - The constructed client. ``` -------------------------------- ### TextToSpeechAsyncClient Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechAsyncClient.html Instantiates the text to speech async client with optional credentials, transport, client options, and client info. ```APIDOC ## TextToSpeechAsyncClient ```python TextToSpeechAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` ### Parameters * **credentials** (Optional[google.auth.credentials.Credentials]) - The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. * **transport** (Optional[Union[str, TextToSpeechTransport, Callable[..., TextToSpeechTransport]]]) - The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the TextToSpeechTransport constructor. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state (preview). We welcome your feedback via an issue in this library's source repository. * **client_options** (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) - Custom options for the client. 1. The `api_endpoint` property can be used to override the default endpoint provided by the client when `transport` is not explicitly provided. Only if this property is not set and `transport` was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the `client_cert_source` property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The `universe_domain` property can be used to override the default "googleapis.com" universe. Note that `api_endpoint` property still takes precedence; and `universe_domain` is currently not supported for mTLS. * **client_info** (google.api_core.gapic_v1.client_info.ClientInfo) - The client info used to send a user-agent string along with API requests. If `None`, then default info will be used. Generally, you only need to set this if you're developing your own client library. ### Exceptions * **google.auth.exceptions.MutualTlsChannelError** - If mutual TLS transport creation failed for any reason. ``` -------------------------------- ### TextToSpeechClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechClient.html Initializes a new instance of the TextToSpeechClient class. ```APIDOC TextToSpeechClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = None, client_options: typing.Optional[ typing.Union[google.api_core.client_options.ClientOptions, dict] ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### from_service_account_json Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechClient.html Creates an instance of the TextToSpeechClient using a service account JSON key file. ```APIDOC ## from_service_account_json Creates an instance of this client using the provided credentials file. ### Parameters * **filename** (str) - Required - The path to the service account private key json file. ### Returns * **TextToSpeechClient** - The constructed client. ``` -------------------------------- ### Initialize TextToSpeechLongAudioSynthesizeAsyncClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.html Initializes the client for the Text-to-Speech long audio synthesize API. You can optionally provide credentials, a transport layer, client options, and client information. ```python TextToSpeechLongAudioSynthesizeAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.transports.base.TextToSpeechLongAudioSynthesizeTransport, typing.Callable[ [...], google.cloud.texttospeech_v1beta1.services.text_to_speech_long_audio_synthesize.transports.base.TextToSpeechLongAudioSynthesizeTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### from_service_account_file Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechAsyncClient.html Creates a TextToSpeechAsyncClient from a service account file. ```APIDOC ## from_service_account_file ### Description Creates a TextToSpeechAsyncClient from a service account file. ### Parameters * **filename** (str): The path to the service account key file. * **credentials_args** (Optional[Dict]): Arguments to pass to the `Credentials` constructor. ``` -------------------------------- ### TextToSpeechClient Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechClient.html Instantiates the TextToSpeechClient. You can provide credentials, specify a transport, and customize client options. ```APIDOC ## TextToSpeechClient ```python TextToSpeechClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = None, client_options: typing.Optional[ typing.Union[google.api_core.client_options.ClientOptions, dict] ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` ### Parameters * **credentials** (`Optional[google.auth.credentials.Credentials]`): Authorization credentials. If none are specified, credentials will be ascertained from the environment. * **transport** (`Optional[Union[str, TextToSpeechTransport, Callable[..., TextToSpeechTransport]]]`): The transport to use, or a Callable that constructs and returns a new transport. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state (preview). * **client_options** (`Optional[Union[google.api_core.client_options.ClientOptions, dict]]`): Custom options for the client. This can include overriding the `api_endpoint`, providing a `client_cert_source` for mTLS, or specifying a `universe_domain`. * **client_info** (`google.api_core.gapic_v1.client_info.ClientInfo`): Client information used to send a user-agent string with API requests. If `None`, default info will be used. ``` -------------------------------- ### Initialize TextToSpeechLongAudioSynthesizeClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeClient.html Initializes the client with optional credentials, transport, client options, and client info. Use this to create an instance of the client for making API requests. ```python TextToSpeechLongAudioSynthesizeClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.transports.base.TextToSpeechLongAudioSynthesizeTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.transports.base.TextToSpeechLongAudioSynthesizeTransport, ], ] ] = None, client_options: typing.Optional[ typing.Union[google.api_core.client_options.ClientOptions, dict] ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### TextToSpeechClient Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Instantiates the text to speech client. This is the primary way to create a client instance for making API calls. ```APIDOC ## TextToSpeechClient(credentials=None, transport=None, client_options=None, client_info=None) ### Description Instantiates the text to speech client. ### Parameters - **credentials** (google.auth.credentials.Credentials) - Optional. Credentials for the client. - **transport** (str or google.cloud.texttospeech_v1beta1.services.text_to_speech.transports.base.TextToSpeechTransport or Callable) - Optional. The transport to use for the client. - **client_options** (google.api_core.client_options.ClientOptions or dict) - Optional. Client options for the client. - **client_info** (google.api_core.gapic_v1.client_info.ClientInfo) - Optional. Client info for the client. ``` -------------------------------- ### TextToSpeechLongAudioSynthesizeClient.from_service_account_file Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Creates a client from a service account file. ```APIDOC ## from_service_account_file ### Description Instantiates a client from a Google service account file. ### Method N/A (Client method) ### Parameters #### Path Parameters - **account_file** (string) - Required - The path to the service account key file. ### Response - **TextToSpeechLongAudioSynthesizeClient** - An instance of the client. ``` -------------------------------- ### Common Path Methods Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient.html Helper methods to construct fully-qualified resource paths. ```APIDOC ### common_billing_account_path ``` common_billing_account_path(billing_account: str) -> str ``` Returns a fully-qualified billing_account string. ### common_folder_path ``` common_folder_path(folder: str) -> str ``` Returns a fully-qualified folder string. ### common_location_path ``` common_location_path(project: str, location: str) -> str ``` Returns a fully-qualified location string. ### common_organization_path ``` common_organization_path(organization: str) -> str ``` Returns a fully-qualified organization string. ### common_project_path ``` common_project_path(project: str) -> str ``` Returns a fully-qualified project string. ``` -------------------------------- ### TextToSpeechClient from_service_account_info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechClient.html Creates an instance of the TextToSpeechClient using the provided credentials info. ```APIDOC ### from_service_account_info ```python from_service_account_info(info: dict, *args, **kwargs) ``` Creates an instance of this client using the provided credentials info. **Parameter** * **info** (`dict`): The service account private key info. **Returns** * `TextToSpeechClient`: The constructed client. ``` -------------------------------- ### Common resource path for project Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Returns a fully-qualified project string. Requires the project ID. ```python common_project_path(project: str) -> str ``` -------------------------------- ### TextToSpeechClient Authentication from File/Info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechClient.html Methods to create a TextToSpeechClient instance using credentials from a service account file or dictionary. ```APIDOC ### from_service_account_file ```python from_service_account_file(filename: str, *args, **kwargs) ``` Creates an instance of this client using the provided credentials file. **Parameter** * **filename** (`str`): The path to the service account private key json file. **Returns** * **TextToSpeechClient**: The constructed client. ### from_service_account_info ```python from_service_account_info(info: dict, *args, **kwargs) ``` Creates an instance of this client using the provided credentials info. **Parameter** * **info** (`dict`): The service account private key info. **Returns** * **TextToSpeechClient**: The constructed client. ``` -------------------------------- ### from_service_account_info Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Creates a TextToSpeechClient instance using provided service account credentials information. ```APIDOC ## from_service_account_info ### Description Creates an instance of this client using the provided credentials info. ### Method Signature `from_service_account_info(info: dict, *args, **kwargs)` ### Parameters * **info** (dict) - A dictionary containing service account credentials. * **args** - Positional arguments. * **kwargs** - Keyword arguments. ``` -------------------------------- ### TextToSpeechLongAudioSynthesizeAsyncClient Constructor Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient Instantiates the text to speech long audio synthesize async client. Allows configuration of credentials, transport, client options, and client info. ```APIDOC ## TextToSpeechLongAudioSynthesizeAsyncClient ### Description Instantiates the text to speech long audio synthesize async client. ### Parameters - **credentials** (Optional[google.auth.credentials.Credentials]) - The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. - **transport** (Optional[Union[str, TextToSpeechLongAudioSynthesizeTransport, Callable[..., TextToSpeechLongAudioSynthesizeTransport]]]) - The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the TextToSpeechLongAudioSynthesizeTransport constructor. If set to None, a transport is chosen automatically. NOTE: "rest" transport functionality is currently in a beta state (preview). We welcome your feedback via an issue in this library's source repository. - **client_options** (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) - Custom options for the client. 1. The `api_endpoint` property can be used to override the default endpoint provided by the client when `transport` is not explicitly provided. Only if this property is not set and `transport` was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the `client_cert_source` property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The `universe_domain` property can be used to override the default "googleapis.com" universe. Note that `api_endpoint` property still takes precedence; and `universe_domain` is currently not supported for mTLS. - **client_info** (google.api_core.gapic_v1.client_info.ClientInfo) - The client info used to send a user-agent string along with API requests. If `None`, then default info will be used. Generally, you only need to set this if you're developing your own client library. ### Exceptions - **google.auth.exceptions.MutualTlsChannelError** - If mutual TLS transport creation failed for any reason. ``` -------------------------------- ### google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/summary_method Instantiates the text to speech client. ```APIDOC ## TextToSpeechClient ### Description Instantiates the text to speech client. ### Parameters - **credentials** (typing.Optional[google.auth.credentials.Credentials]) - Optional. Credentials for the service. - **transport** (typing.Optional[typing.Union[str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[..., google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport]]]) - Optional. The transport to use for the client. - **client_options** (typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]]) - Optional. Client options for the service. - **client_info** (google.api_core.gapic_v1.client_info.ClientInfo) - Optional. Client information for the service. ### Request Example ```python from google.cloud.texttospeech_v1.services import text_to_speech client = text_to_speech.TextToSpeechClient() ``` ``` -------------------------------- ### Instantiate TextToSpeechClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1beta1.services.text_to_speech.TextToSpeechClient.html Instantiates a TextToSpeechClient. This client is used to interact with the Google Cloud Text-to-Speech API. It can be configured with credentials, transport, client options, and client info. ```python from google.cloud.texttospeech_v1beta1.services.text_to_speech import TextToSpeechClient client = TextToSpeechClient() ``` -------------------------------- ### Instantiate TextToSpeechAsyncClient Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient Instantiates the asynchronous client for the Text-to-Speech API. Supports custom credentials, transport methods, client options, and client info. ```python TextToSpeechAsyncClient( *, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[ typing.Union[ str, google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, typing.Callable[ [...], google.cloud.texttospeech_v1.services.text_to_speech.transports.base.TextToSpeechTransport, ], ] ] = "grpc_asyncio", client_options: typing.Optional[ google.api_core.client_options.ClientOptions ] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = google.api_core.gapic_v1.client_info.ClientInfo ) ``` -------------------------------- ### Construct Model Path Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech_long_audio_synthesize.TextToSpeechLongAudioSynthesizeAsyncClient.html Returns a fully-qualified model string. Use this to reference specific models for synthesis. ```python model_path(project: str, location: str, model: str) -> str ``` -------------------------------- ### Format Project Path Source: https://docs.cloud.google.com/python/docs/reference/texttospeech/latest/google.cloud.texttospeech_v1.services.text_to_speech.TextToSpeechAsyncClient Generates a fully-qualified resource path for a project. Requires the project ID. ```python common_project_path(project: str) -> str ```