Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class OutputAudioConfig.
Instructs the speech synthesizer on how to generate the output audio content.
If this audio config is supplied in a request, it overrides all existing
text-to-speech settings applied to the agent.
Generated from protobuf message google.cloud.dialogflow.v2.OutputAudioConfig
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ audio_encoding
int
Required. Audio encoding of the synthesized audio content.
↳ sample_rate_hertz
int
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).
Configuration of how speech should be synthesized.
getAudioEncoding
Required. Audio encoding of the synthesized audio content.
Returns
Type
Description
int
setAudioEncoding
Required. Audio encoding of the synthesized audio content.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getSampleRateHertz
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
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).
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getSynthesizeSpeechConfig
Configuration of how speech should be synthesized.
[[["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 OutputAudioConfig (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.OutputAudioConfig)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.OutputAudioConfig)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.OutputAudioConfig)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.OutputAudioConfig)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.OutputAudioConfig)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.OutputAudioConfig)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.OutputAudioConfig)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.OutputAudioConfig)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.OutputAudioConfig)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.OutputAudioConfig)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.OutputAudioConfig)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.OutputAudioConfig)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.OutputAudioConfig)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.OutputAudioConfig)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.OutputAudioConfig)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.OutputAudioConfig)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.OutputAudioConfig)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.OutputAudioConfig)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.OutputAudioConfig)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.OutputAudioConfig)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.OutputAudioConfig) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class OutputAudioConfig.\n\nInstructs the speech synthesizer on how to generate the output audio content.\n\nIf this audio config is supplied in a request, it overrides all existing\ntext-to-speech settings applied to the agent.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.OutputAudioConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getAudioEncoding\n\nRequired. Audio encoding of the synthesized audio content.\n\n### setAudioEncoding\n\nRequired. Audio encoding of the synthesized audio content.\n\n### getSampleRateHertz\n\nThe 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\nThe 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### getSynthesizeSpeechConfig\n\nConfiguration of how speech should be synthesized.\n\n### hasSynthesizeSpeechConfig\n\n### clearSynthesizeSpeechConfig\n\n### setSynthesizeSpeechConfig\n\nConfiguration of how speech should be synthesized."]]