NAME
Google::Cloud::Dialogflow::V2::AudioConfig - Compiled Protocol Buffers messages for google/cloud/dialogflow/v2/audio_config.proto
SYNOPSIS
use Google::Cloud::Dialogflow::V2::AudioConfig;
my $msg = Google::Cloud::Dialogflow::V2::AudioConfig::SpeechContext->new({
phrases => $phrases,
boost => $boost,
});
# Read or update a field
my $val = $msg->phrases();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Dialogflow::V2::AudioConfig::SpeechContext->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/dialogflow/v2/audio_config.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Dialogflow::V2::AudioConfig::SpeechContext
Hints for the speech recognizer to help with recognition in a specific conversation state.
Inherits from Protobuf::Message.
Accessors
$msg->phrases()/$msg->phrases($value)Type:
StringOptional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood.
This list can be used to:
* improve accuracy for words and phrases you expect the user to say, e.g. typical commands for your Dialogflow agent * add additional words to the speech recognizer vocabulary * ...
See the [Cloud Speech documentation](https://cloud.google.com/speech-to-text/quotas) for usage limits.
$msg->boost()/$msg->boost($value)Type:
FloatOptional. Boost for this context compared to other contexts:
* If the boost is positive, Dialogflow will increase the probability that the phrases in this context are recognized over similar sounding phrases. * If the boost is unspecified or non-positive, Dialogflow will not apply any boost.
Dialogflow recommends that you use boosts in the range (0, 20] and that you find a value that fits your use case with binary search.
Google::Cloud::Dialogflow::V2::AudioConfig::SpeechWordInfo
Information for a word recognized by the speech recognizer.
Inherits from Protobuf::Message.
Accessors
$msg->word()/$msg->word($value)Type:
StringThe word this info is for.
$msg->start_offset()/$msg->start_offset($value)Type:
Message(Google::Protobuf::Duration::Duration)Time offset relative to the beginning of the audio that corresponds to the start of the spoken word. This is an experimental feature and the accuracy of the time offset can vary.
$msg->end_offset()/$msg->end_offset($value)Type:
Message(Google::Protobuf::Duration::Duration)Time offset relative to the beginning of the audio that corresponds to the end of the spoken word. This is an experimental feature and the accuracy of the time offset can vary.
$msg->confidence()/$msg->confidence($value)Type:
FloatThe Speech confidence between 0.0 and 1.0 for this word. A higher number indicates an estimated greater likelihood that the recognized word is correct. The default of 0.0 is a sentinel value indicating that confidence was not set.
This field is not guaranteed to be fully stable over time for the same audio input. Users should also not rely on it to always be provided.
Google::Cloud::Dialogflow::V2::AudioConfig::InputAudioConfig
Instructs the speech recognizer how to process the audio content.
Inherits from Protobuf::Message.
Accessors
$msg->audio_encoding()/$msg->audio_encoding($value)Type:
Enum(Google::Cloud::Dialogflow::V2::AudioEncoding)Required. Audio encoding of the audio content to process.
$msg->sample_rate_hertz()/$msg->sample_rate_hertz($value)Type:
Int32Required. Sample rate (in Hertz) of the audio content sent in the query. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) for more details.
$msg->language_code()/$msg->language_code($value)Type:
StringRequired. The language of the supplied audio. Dialogflow does not do translations. See [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) for a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language. If not set, the language is inferred from the [ConversationProfile.stt_config][google.cloud.dialogflow.v2.ConversationProfile.stt_config].
$msg->enable_word_info()/$msg->enable_word_info($value)Type:
BoolIf `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information.
$msg->phrase_hints()/$msg->phrase_hints($value)Type:
StringA list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood.
See [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) for more details.
This field is deprecated. Please use [`speech_contexts`]() instead. If you specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will treat the [`phrase_hints`]() as a single additional [`SpeechContext`]().
$msg->speech_contexts()/$msg->speech_contexts($value)Type:
Message(Google::Cloud::Dialogflow::V2::AudioConfig::SpeechContext)Context information to assist speech recognition.
See [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) for more details.
$msg->model()/$msg->model($value)Type:
StringOptional. Which Speech model to select for the given request. For more information, see [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models).
$msg->model_variant()/$msg->model_variant($value)Type:
Enum(Google::Cloud::Dialogflow::V2::SpeechModelVariant)Which variant of the [Speech model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use.
$msg->single_utterance()/$msg->single_utterance($value)Type:
BoolIf `false` (default), recognition does not cease until the client closes the stream. If `true`, the recognizer will detect a single spoken utterance in input audio. Recognition ceases when it detects the audio's voice has stopped or paused. In this case, once a detected intent is received, the client should close the stream and start a new request with a new stream as needed. Note: This setting is relevant only for streaming methods. Note: When specified, InputAudioConfig.single_utterance takes precedence over StreamingDetectIntentRequest.single_utterance.
$msg->enable_voice_activity_events()/$msg->enable_voice_activity_events($value)Type:
BoolOptional. If `true`, responses with voice activity speech events will be returned as they are detected. Note: This setting is relevant only for streaming methods.
$msg->disable_no_speech_recognized_event()/$msg->disable_no_speech_recognized_event($value)Type:
BoolOnly used in [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] and [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. If `false` and recognition doesn't return any result, trigger `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.
$msg->enable_automatic_punctuation()/$msg->enable_automatic_punctuation($value)Type:
BoolEnable automatic punctuation option at the speech backend.
$msg->phrase_sets()/$msg->phrase_sets($value)Type:
StringA collection of phrase set resources to use for speech adaptation.
$msg->opt_out_conformer_model_migration()/$msg->opt_out_conformer_model_migration($value)Type:
BoolIf `true`, the request will opt out for STT conformer model migration. This field will be deprecated once force migration takes place in June 2024. Please refer to [Dialogflow ES Speech model migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration).
$msg->gemini_asr_config()/$msg->gemini_asr_config($value)Type:
Message(Google::Cloud::Dialogflow::V2::AudioConfig::SpeechToTextConfig::GeminiAsrConfig)Optional. Configuration for using Gemini ASR models served via Vertex AI. This field is only used when `use_gemini_asr` is true.
$msg->use_gemini_asr()/$msg->use_gemini_asr($value)Type:
BoolOptional. If true, Gemini ASR will be used for transcription instead of Cloud Speech-to-Text. If false, Cloud Speech-to-Text will be used. If unset, this setting is inherited from the ConversationProfile.
$msg->disable_interim_input_transcripts()/$msg->disable_interim_input_transcripts($value)Type:
BoolOptional. Disables emission of interim input transcriptions when set to `true`.
Google::Cloud::Dialogflow::V2::AudioConfig::VoiceSelectionParams
Description of which voice to use for speech synthesis.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringOptional. The name of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and [ssml_gender][google.cloud.dialogflow.v2.VoiceSelectionParams.ssml_gender].
$msg->ssml_gender()/$msg->ssml_gender($value)Type:
Enum(Google::Cloud::Dialogflow::V2::SsmlVoiceGender)Optional. The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and [name][google.cloud.dialogflow.v2.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.
Google::Cloud::Dialogflow::V2::AudioConfig::SynthesizeSpeechConfig
Configuration of how speech should be synthesized.
Inherits from Protobuf::Message.
Accessors
$msg->speaking_rate()/$msg->speaking_rate($value)Type:
DoubleOptional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other values < 0.25 or > 4.0 will return an error.
$msg->pitch()/$msg->pitch($value)Type:
DoubleOptional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 semitones from the original pitch. -20 means decrease 20 semitones from the original pitch.
$msg->volume_gain_db()/$msg->volume_gain_db($value)Type:
DoubleOptional. Volume gain (in dB) of the normal native volume supported by the specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) will play at approximately half the amplitude of the normal native signal amplitude. A value of +6.0 (dB) will play at approximately twice the amplitude of the normal native signal amplitude. We strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that.
$msg->effects_profile_id()/$msg->effects_profile_id($value)Type:
StringOptional. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied on top of each other in the order they are given.
$msg->voice()/$msg->voice($value)Type:
Message(Google::Cloud::Dialogflow::V2::AudioConfig::VoiceSelectionParams)Optional. The desired voice of the synthesized audio.
$msg->pronunciations()/$msg->pronunciations($value)Type:
Message(Google::Cloud::Dialogflow::V2::AudioConfig::CustomPronunciationParams)Optional. The custom pronunciations for the synthesized audio.
Google::Cloud::Dialogflow::V2::AudioConfig::CustomPronunciationParams
Pronunciation customization for a phrase.
Inherits from Protobuf::Message.
Accessors
$msg->phrase()/$msg->phrase($value)Type:
StringThe phrase to which the customization is applied. The phrase can be multiple words, such as proper nouns, but shouldn't span the length of the sentence.
$msg->phonetic_encoding()/$msg->phonetic_encoding($value)Type:
Enum(Google::Cloud::Dialogflow::V2::CustomPronunciationParams::PhoneticEncoding)The phonetic encoding of the phrase.
$msg->pronunciation()/$msg->pronunciation($value)Type:
StringThe pronunciation of the phrase. This must be in the phonetic encoding specified above.
Enum: CustomPronunciationParams::PhoneticEncoding
PHONETIC_ENCODING_UNSPECIFIED=>0PHONETIC_ENCODING_IPA=>1PHONETIC_ENCODING_X_SAMPA=>2
Google::Cloud::Dialogflow::V2::AudioConfig::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.
Inherits from Protobuf::Message.
Accessors
$msg->audio_encoding()/$msg->audio_encoding($value)Type:
Enum(Google::Cloud::Dialogflow::V2::OutputAudioEncoding)Required. Audio encoding of the synthesized audio content.
$msg->sample_rate_hertz()/$msg->sample_rate_hertz($value)Type:
Int32The 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).
$msg->synthesize_speech_config()/$msg->synthesize_speech_config($value)Type:
Message(Google::Cloud::Dialogflow::V2::AudioConfig::SynthesizeSpeechConfig)Configuration of how speech should be synthesized.
Google::Cloud::Dialogflow::V2::AudioConfig::TelephonyDtmfEvents
A wrapper of repeated TelephonyDtmf digits.
Inherits from Protobuf::Message.
Accessors
$msg->dtmf_events()/$msg->dtmf_events($value)Type:
Enum(Google::Cloud::Dialogflow::V2::TelephonyDtmf)A sequence of TelephonyDtmf digits.
Google::Cloud::Dialogflow::V2::AudioConfig::SpeechToTextConfig
Configures speech transcription for [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile].
Inherits from Protobuf::Message.
Accessors
$msg->speech_model_variant()/$msg->speech_model_variant($value)Type:
Enum(Google::Cloud::Dialogflow::V2::SpeechModelVariant)The speech model used in speech to text. `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as `USE_ENHANCED`. It can be overridden in [AnalyzeContentRequest][google.cloud.dialogflow.v2.AnalyzeContentRequest] and [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] request. If enhanced model variant is specified and an enhanced version of the specified model for the language does not exist, then it would emit an error.
$msg->model()/$msg->model($value)Type:
StringWhich Speech model to select. Select the model best suited to your domain to get best results. If a model is not explicitly specified, then Dialogflow auto-selects a model based on other parameters in the SpeechToTextConfig and Agent settings. If enhanced speech model is enabled for the agent and an enhanced version of the specified model for the language does not exist, then the speech is recognized using the standard version of the specified model. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) for more details. If you specify a model, the following models typically have the best performance:
- phone_call (best for Agent Assist and telephony) - latest_short (best for Dialogflow non-telephony) - command_and_search
Leave this field unspecified to use [Agent Speech settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) for model selection.
$msg->phrase_sets()/$msg->phrase_sets($value)Type:
StringList of names of Cloud Speech phrase sets that are used for transcription. For phrase set limitations, please refer to [Cloud Speech API quotas and limits](https://cloud.google.com/speech-to-text/quotas#content).
$msg->audio_encoding()/$msg->audio_encoding($value)Type:
Enum(Google::Cloud::Dialogflow::V2::AudioEncoding)Audio encoding of the audio content to process.
$msg->sample_rate_hertz()/$msg->sample_rate_hertz($value)Type:
Int32Sample rate (in Hertz) of the audio content sent in the query. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) for more details.
$msg->language_code()/$msg->language_code($value)Type:
StringThe language of the supplied audio. Dialogflow does not do translations. See [Language Support](https://cloud.google.com/dialogflow/docs/reference/language) for a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language. If not specified, the default language configured at [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] is used.
$msg->enable_word_info()/$msg->enable_word_info($value)Type:
BoolIf `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.v2.SpeechWordInfo] in [StreamingRecognitionResult][google.cloud.dialogflow.v2.StreamingRecognitionResult] with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information.
$msg->use_timeout_based_endpointing()/$msg->use_timeout_based_endpointing($value)Type:
BoolUse timeout based endpointing, interpreting endpointer sensitivity as seconds of timeout value.
$msg->gemini_asr_config()/$msg->gemini_asr_config($value)Type:
Message(Google::Cloud::Dialogflow::V2::AudioConfig::SpeechToTextConfig::GeminiAsrConfig)Optional. Configuration for using Gemini ASR models served via Vertex AI, overriding the default Gemini ASR model or providing additional advanced parameters. This field is only used when `use_gemini_asr` is true.
$msg->use_gemini_asr()/$msg->use_gemini_asr($value)Type:
BoolOptional. If true, Gemini ASR will be used for transcription instead of Cloud Speech-to-Text.
$msg->disable_interim_input_transcripts()/$msg->disable_interim_input_transcripts($value)Type:
BoolOptional. Disables emission of interim input transcriptions when set to `true`.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Dialogflow::V2::AudioConfig::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.