# Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::InputAudioConfig (v1.16.1)

1.16.1 (latest) 1.16.0 1.15.0 1.14.0 1.13.0 1.12.1 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.1 1.3.0 1.2.0 1.1.1 1.0.0 0.34.0 0.33.0 0.32.2 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.26.2 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.0 0.15.2 0.14.0 0.13.0 0.12.0 Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::InputAudioConfig.

Instructs the speech recognizer how to process the audio content.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #audio_encoding

    def audio_encoding() -> ::Google::Cloud::Dialogflow::V2::AudioEncoding

**Returns**

- ([::Google::Cloud::Dialogflow::V2::AudioEncoding](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-AudioEncoding)) --- Required. Audio encoding of the audio content to process.

### #audio_encoding=

    def audio_encoding=(value) -> ::Google::Cloud::Dialogflow::V2::AudioEncoding

**Parameter**

- **value** ([::Google::Cloud::Dialogflow::V2::AudioEncoding](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-AudioEncoding)) --- Required. Audio encoding of the audio content to process.
**Returns**

- ([::Google::Cloud::Dialogflow::V2::AudioEncoding](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-AudioEncoding)) --- Required. Audio encoding of the audio content to process.

### #disable_no_speech_recognized_event

    def disable_no_speech_recognized_event() -> ::Boolean

**Returns**

- (::Boolean) --- Only used in [Participants.AnalyzeContent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client#Google__Cloud__Dialogflow__V2__Participants__Client_analyze_content_instance_ "Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content (method)") and [Participants.StreamingAnalyzeContent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client#Google__Cloud__Dialogflow__V2__Participants__Client_streaming_analyze_content_instance_ "Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content (method)"). If `false` and recognition doesn't return any result, trigger `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.

### #disable_no_speech_recognized_event=

    def disable_no_speech_recognized_event=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Only used in [Participants.AnalyzeContent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client#Google__Cloud__Dialogflow__V2__Participants__Client_analyze_content_instance_ "Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content (method)") and [Participants.StreamingAnalyzeContent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client#Google__Cloud__Dialogflow__V2__Participants__Client_streaming_analyze_content_instance_ "Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content (method)"). If `false` and recognition doesn't return any result, trigger `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.
**Returns**

- (::Boolean) --- Only used in [Participants.AnalyzeContent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client#Google__Cloud__Dialogflow__V2__Participants__Client_analyze_content_instance_ "Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content (method)") and [Participants.StreamingAnalyzeContent](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-Participants-Client#Google__Cloud__Dialogflow__V2__Participants__Client_streaming_analyze_content_instance_ "Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content (method)"). If `false` and recognition doesn't return any result, trigger `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.

### #enable_automatic_punctuation

    def enable_automatic_punctuation() -> ::Boolean

**Returns**

- (::Boolean) --- Enable automatic punctuation option at the speech backend.

### #enable_automatic_punctuation=

    def enable_automatic_punctuation=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Enable automatic punctuation option at the speech backend.
**Returns**

- (::Boolean) --- Enable automatic punctuation option at the speech backend.

### #enable_word_info

    def enable_word_info() -> ::Boolean

**Returns**

- (::Boolean) --- If `true`, Dialogflow returns [SpeechWordInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SpeechWordInfo "Google::Cloud::Dialogflow::V2::SpeechWordInfo (class)") in [StreamingRecognitionResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-StreamingRecognitionResult "Google::Cloud::Dialogflow::V2::StreamingRecognitionResult (class)") 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.

### #enable_word_info=

    def enable_word_info=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If `true`, Dialogflow returns [SpeechWordInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SpeechWordInfo "Google::Cloud::Dialogflow::V2::SpeechWordInfo (class)") in [StreamingRecognitionResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-StreamingRecognitionResult "Google::Cloud::Dialogflow::V2::StreamingRecognitionResult (class)") 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.
**Returns**

- (::Boolean) --- If `true`, Dialogflow returns [SpeechWordInfo](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SpeechWordInfo "Google::Cloud::Dialogflow::V2::SpeechWordInfo (class)") in [StreamingRecognitionResult](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-StreamingRecognitionResult "Google::Cloud::Dialogflow::V2::StreamingRecognitionResult (class)") 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.

### #language_code

    def language_code() -> ::String

**Returns**

- (::String) --- Required. 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ConversationProfile#Google__Cloud__Dialogflow__V2__ConversationProfile_stt_config_instance_ "Google::Cloud::Dialogflow::V2::ConversationProfile#stt_config (method)").

### #language_code=

    def language_code=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ConversationProfile#Google__Cloud__Dialogflow__V2__ConversationProfile_stt_config_instance_ "Google::Cloud::Dialogflow::V2::ConversationProfile#stt_config (method)").
**Returns**

- (::String) --- Required. 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-ConversationProfile#Google__Cloud__Dialogflow__V2__ConversationProfile_stt_config_instance_ "Google::Cloud::Dialogflow::V2::ConversationProfile#stt_config (method)").

### #model

    def model() -> ::String

**Returns**

- (::String) --- Optional. Which Speech model to select for the given request. For more information, see [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models).

### #model=

    def model=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. Which Speech model to select for the given request. For more information, see [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models).
**Returns**

- (::String) --- Optional. Which Speech model to select for the given request. For more information, see [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models).

### #model_variant

    def model_variant() -> ::Google::Cloud::Dialogflow::V2::SpeechModelVariant

**Returns**

- ([::Google::Cloud::Dialogflow::V2::SpeechModelVariant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SpeechModelVariant)) --- Which variant of the \[Speech model\]\[google.cloud.dialogflow.v2.InputAudioConfig.model\] to use.

### #model_variant=

    def model_variant=(value) -> ::Google::Cloud::Dialogflow::V2::SpeechModelVariant

**Parameter**

- **value** ([::Google::Cloud::Dialogflow::V2::SpeechModelVariant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SpeechModelVariant)) --- Which variant of the \[Speech model\]\[google.cloud.dialogflow.v2.InputAudioConfig.model\] to use.
**Returns**

- ([::Google::Cloud::Dialogflow::V2::SpeechModelVariant](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-SpeechModelVariant)) --- Which variant of the \[Speech model\]\[google.cloud.dialogflow.v2.InputAudioConfig.model\] to use.

### #opt_out_conformer_model_migration

    def opt_out_conformer_model_migration() -> ::Boolean

**Returns**

- (::Boolean) --- If `true`, the request will opt out for STT conformer model migration.
  This field will be deprecated once force migration takes place in June

  1. Please refer to [Dialogflow ES Speech model
     migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration).

### #opt_out_conformer_model_migration=

    def opt_out_conformer_model_migration=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) ---

  If `true`, the request will opt out for STT conformer model migration.
  This field will be deprecated once force migration takes place in June
  1. Please refer to [Dialogflow ES Speech model
     migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration).
**Returns**

- (::Boolean) --- If `true`, the request will opt out for STT conformer model migration.
  This field will be deprecated once force migration takes place in June

  1. Please refer to [Dialogflow ES Speech model
     migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration).

### #phrase_hints

    def phrase_hints() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- A 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`]().

### #phrase_hints=

    def phrase_hints=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- A 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`]().
**Returns**

- (::Array\<::String\>) --- A 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`]().

### #phrase_sets

    def phrase_sets() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- A collection of phrase set resources to use for speech adaptation.

### #phrase_sets=

    def phrase_sets=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- A collection of phrase set resources to use for speech adaptation.
**Returns**

- (::Array\<::String\>) --- A collection of phrase set resources to use for speech adaptation.

### #sample_rate_hertz

    def sample_rate_hertz() -> ::Integer

**Returns**

- (::Integer) --- Required. 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.

### #sample_rate_hertz=

    def sample_rate_hertz=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Required. 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.
**Returns**

- (::Integer) --- Required. 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.

### #single_utterance

    def single_utterance() -> ::Boolean

**Returns**

- (::Boolean) --- If `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.

### #single_utterance=

    def single_utterance=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If `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.
**Returns**

- (::Boolean) --- If `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.

### #speech_contexts

    def speech_contexts() -> ::Array<::Google::Cloud::Dialogflow::V2::SpeechContext>

**Returns**

- (::Array\<[::Google::Cloud::Dialogflow::V2::SpeechContext](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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.

### #speech_contexts=

    def speech_contexts=(value) -> ::Array<::Google::Cloud::Dialogflow::V2::SpeechContext>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Dialogflow::V2::SpeechContext](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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.
**Returns**

- (::Array\<[::Google::Cloud::Dialogflow::V2::SpeechContext](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-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.