Class: Google::Cloud::Speech::V1::StreamingRecognitionConfig
- Inherits:
-
Object
- Object
- Google::Cloud::Speech::V1::StreamingRecognitionConfig
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/cloud/speech/v1/cloud_speech.rb
Overview
Provides information to the recognizer that specifies how to process the request.
Defined Under Namespace
Classes: VoiceActivityTimeout
Instance Attribute Summary collapse
-
#config ⇒ ::Google::Cloud::Speech::V1::RecognitionConfig
Required.
-
#enable_voice_activity_events ⇒ ::Boolean
If
true
, responses with voice activity speech events will be returned as they are detected. -
#interim_results ⇒ ::Boolean
If
true
, interim results (tentative hypotheses) may be returned as they become available (these interim results are indicated with theis_final=false
flag). -
#single_utterance ⇒ ::Boolean
If
false
or omitted, the recognizer will perform continuous recognition (continuing to wait for and process audio even if the user pauses speaking) until the client closes the input stream (gRPC API) or until the maximum time limit has been reached. -
#voice_activity_timeout ⇒ ::Google::Cloud::Speech::V1::StreamingRecognitionConfig::VoiceActivityTimeout
If set, the server will automatically close the stream after the specified duration has elapsed after the last VOICE_ACTIVITY speech event has been sent.
Instance Attribute Details
#config ⇒ ::Google::Cloud::Speech::V1::RecognitionConfig
Returns Required. Provides information to the recognizer that specifies how to process the request.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'proto_docs/google/cloud/speech/v1/cloud_speech.rb', line 134 class StreamingRecognitionConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Events that a timeout can be set on for voice activity. # @!attribute [rw] speech_start_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream if no speech begins. # @!attribute [rw] speech_end_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream after speech ends. class VoiceActivityTimeout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#enable_voice_activity_events ⇒ ::Boolean
Returns If true
, responses with voice activity speech events will be returned as
they are detected.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'proto_docs/google/cloud/speech/v1/cloud_speech.rb', line 134 class StreamingRecognitionConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Events that a timeout can be set on for voice activity. # @!attribute [rw] speech_start_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream if no speech begins. # @!attribute [rw] speech_end_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream after speech ends. class VoiceActivityTimeout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#interim_results ⇒ ::Boolean
If true
, interim results (tentative hypotheses) may be
returned as they become available (these interim results are indicated with
the is_final=false
flag).
If false
or omitted, only is_final=true
result(s) are returned.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'proto_docs/google/cloud/speech/v1/cloud_speech.rb', line 134 class StreamingRecognitionConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Events that a timeout can be set on for voice activity. # @!attribute [rw] speech_start_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream if no speech begins. # @!attribute [rw] speech_end_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream after speech ends. class VoiceActivityTimeout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#single_utterance ⇒ ::Boolean
Returns If false
or omitted, the recognizer will perform continuous
recognition (continuing to wait for and process audio even if the user
pauses speaking) until the client closes the input stream (gRPC API) or
until the maximum time limit has been reached. May return multiple
StreamingRecognitionResult
s with the is_final
flag set to true
.
If true
, the recognizer will detect a single spoken utterance. When it
detects that the user has paused or stopped speaking, it will return an
END_OF_SINGLE_UTTERANCE
event and cease recognition. It will return no
more than one StreamingRecognitionResult
with the is_final
flag set to
true
.
The single_utterance
field can only be used with specified models,
otherwise an error is thrown. The model
field in [RecognitionConfig
][]
must be set to:
command_and_search
phone_call
AND additional fielduseEnhanced
=true
- The
model
field is left undefined. In this case the API auto-selects a model based on any other parameters that you set inRecognitionConfig
.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'proto_docs/google/cloud/speech/v1/cloud_speech.rb', line 134 class StreamingRecognitionConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Events that a timeout can be set on for voice activity. # @!attribute [rw] speech_start_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream if no speech begins. # @!attribute [rw] speech_end_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream after speech ends. class VoiceActivityTimeout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#voice_activity_timeout ⇒ ::Google::Cloud::Speech::V1::StreamingRecognitionConfig::VoiceActivityTimeout
Returns If set, the server will automatically close the stream after the specified
duration has elapsed after the last VOICE_ACTIVITY speech event has been
sent. The field voice_activity_events
must also be set to true.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'proto_docs/google/cloud/speech/v1/cloud_speech.rb', line 134 class StreamingRecognitionConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Events that a timeout can be set on for voice activity. # @!attribute [rw] speech_start_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream if no speech begins. # @!attribute [rw] speech_end_timeout # @return [::Google::Protobuf::Duration] # Duration to timeout the stream after speech ends. class VoiceActivityTimeout include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |