Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class TextToSpeechSettings.
Instructs the speech synthesizer on how to generate the output audio content.
Generated from protobuf message google.cloud.dialogflow.v2.TextToSpeechSettings
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ enable_text_to_speech
bool
Optional. Indicates whether text to speech is enabled. Even when this field is false, other settings in this proto are still retained.
↳ output_audio_encoding
int
Required. Audio encoding of the synthesized audio content.
↳ sample_rate_hertz
int
Optional. The synthesis sample rate (in hertz) for this audio. If not provided, then the synthesizer will use the default sample rate based on the audio encoding. If this is different from the voice's natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality).
Optional. Indicates whether text to speech is enabled. Even when this field
is false, other settings in this proto are still retained.
Returns
Type
Description
bool
setEnableTextToSpeech
Optional. Indicates whether text to speech is enabled. Even when this field
is false, other settings in this proto are still retained.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getOutputAudioEncoding
Required. Audio encoding of the synthesized audio content.
Returns
Type
Description
int
setOutputAudioEncoding
Required. Audio encoding of the synthesized audio content.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getSampleRateHertz
Optional. The synthesis sample rate (in hertz) for this audio. If not
provided, then the synthesizer will use the default sample rate based on
the audio encoding. If this is different from the voice's natural sample
rate, then the synthesizer will honor this request by converting to the
desired sample rate (which might result in worse audio quality).
Returns
Type
Description
int
setSampleRateHertz
Optional. The synthesis sample rate (in hertz) for this audio. If not
provided, then the synthesizer will use the default sample rate based on
the audio encoding. If this is different from the voice's natural sample
rate, then the synthesizer will honor this request by converting to the
desired sample rate (which might result in worse audio quality).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class TextToSpeechSettings (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.TextToSpeechSettings)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.TextToSpeechSettings)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.TextToSpeechSettings)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.TextToSpeechSettings)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.TextToSpeechSettings)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.TextToSpeechSettings)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.TextToSpeechSettings)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.TextToSpeechSettings)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.TextToSpeechSettings)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.TextToSpeechSettings)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.TextToSpeechSettings)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.TextToSpeechSettings)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.TextToSpeechSettings)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.TextToSpeechSettings)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.TextToSpeechSettings)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.TextToSpeechSettings)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.TextToSpeechSettings)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.TextToSpeechSettings)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.TextToSpeechSettings)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.TextToSpeechSettings)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.TextToSpeechSettings) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class TextToSpeechSettings.\n\nInstructs the speech synthesizer on how to generate the output audio content.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.TextToSpeechSettings`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getEnableTextToSpeech\n\nOptional. Indicates whether text to speech is enabled. Even when this field\nis false, other settings in this proto are still retained.\n\n### setEnableTextToSpeech\n\nOptional. Indicates whether text to speech is enabled. Even when this field\nis false, other settings in this proto are still retained.\n\n### getOutputAudioEncoding\n\nRequired. Audio encoding of the synthesized audio content.\n\n### setOutputAudioEncoding\n\nRequired. Audio encoding of the synthesized audio content.\n\n### getSampleRateHertz\n\nOptional. The synthesis sample rate (in hertz) for this audio. If not\nprovided, then the synthesizer will use the default sample rate based on\nthe audio encoding. If this is different from the voice's natural sample\nrate, then the synthesizer will honor this request by converting to the\ndesired sample rate (which might result in worse audio quality).\n\n### setSampleRateHertz\n\nOptional. The synthesis sample rate (in hertz) for this audio. If not\nprovided, then the synthesizer will use the default sample rate based on\nthe audio encoding. If this is different from the voice's natural sample\nrate, then the synthesizer will honor this request by converting to the\ndesired sample rate (which might result in worse audio quality).\n\n### getSynthesizeSpeechConfigs\n\nOptional. Configuration of how speech should be synthesized, mapping from\nlanguage (\u003chttps://cloud.google.com/dialogflow/docs/reference/language\u003e) to\nSynthesizeSpeechConfig.\n\n### setSynthesizeSpeechConfigs\n\nOptional. Configuration of how speech should be synthesized, mapping from\nlanguage (\u003chttps://cloud.google.com/dialogflow/docs/reference/language\u003e) to\nSynthesizeSpeechConfig."]]