Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::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.
(::Integer) — 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).
#sample_rate_hertz=
defsample_rate_hertz=(value)->::Integer
Parameter
value (::Integer) — 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
(::Integer) — 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-09 UTC."],[],[],null,["# Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::OutputAudioConfig (v1.10.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.10.1 (latest)](/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.10.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.10.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.9.1](/ruby/docs/reference/google-cloud-dialogflow-v2/1.9.1/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.8.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.8.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.7.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.7.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.6.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.6.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.5.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.5.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.4.1](/ruby/docs/reference/google-cloud-dialogflow-v2/1.4.1/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.3.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.3.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.2.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.2.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.1.1](/ruby/docs/reference/google-cloud-dialogflow-v2/1.1.1/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [1.0.0](/ruby/docs/reference/google-cloud-dialogflow-v2/1.0.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.34.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.34.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.33.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.33.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.32.2](/ruby/docs/reference/google-cloud-dialogflow-v2/0.32.2/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.31.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.31.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.30.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.30.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.29.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.29.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.28.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.28.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.27.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.27.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.26.2](/ruby/docs/reference/google-cloud-dialogflow-v2/0.26.2/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.25.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.25.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.24.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.24.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.23.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.23.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.22.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.22.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.21.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.21.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.20.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.20.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.19.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.19.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.18.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.18.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.17.1](/ruby/docs/reference/google-cloud-dialogflow-v2/0.17.1/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.16.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.16.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.15.2](/ruby/docs/reference/google-cloud-dialogflow-v2/0.15.2/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.14.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.14.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.13.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.13.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig)\n- [0.12.0](/ruby/docs/reference/google-cloud-dialogflow-v2/0.12.0/Google-Cloud-Dialogflow-V2-OutputAudioConfig) \nReference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::OutputAudioConfig.\n\nInstructs the speech synthesizer on how to generate the output audio content.\nIf this audio config is supplied in a request, it overrides all existing\ntext-to-speech settings applied to the agent. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #audio_encoding\n\n def audio_encoding() -\u003e ::Google::Cloud::Dialogflow::V2::OutputAudioEncoding\n\n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::OutputAudioEncoding](./Google-Cloud-Dialogflow-V2-OutputAudioEncoding)) --- Required. Audio encoding of the synthesized audio content.\n\n### #audio_encoding=\n\n def audio_encoding=(value) -\u003e ::Google::Cloud::Dialogflow::V2::OutputAudioEncoding\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Dialogflow::V2::OutputAudioEncoding](./Google-Cloud-Dialogflow-V2-OutputAudioEncoding)) --- Required. Audio encoding of the synthesized audio content. \n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::OutputAudioEncoding](./Google-Cloud-Dialogflow-V2-OutputAudioEncoding)) --- Required. Audio encoding of the synthesized audio content.\n\n### #sample_rate_hertz\n\n def sample_rate_hertz() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- 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).\n\n### #sample_rate_hertz=\n\n def sample_rate_hertz=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- 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). \n**Returns**\n\n- (::Integer) --- 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).\n\n### #synthesize_speech_config\n\n def synthesize_speech_config() -\u003e ::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig\n\n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig](./Google-Cloud-Dialogflow-V2-SynthesizeSpeechConfig)) --- Configuration of how speech should be synthesized.\n\n### #synthesize_speech_config=\n\n def synthesize_speech_config=(value) -\u003e ::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig](./Google-Cloud-Dialogflow-V2-SynthesizeSpeechConfig)) --- Configuration of how speech should be synthesized. \n**Returns**\n\n- ([::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig](./Google-Cloud-Dialogflow-V2-SynthesizeSpeechConfig)) --- Configuration of how speech should be synthesized."]]