shared/output/cloud/speech_v1/lib/google/cloud/speech/v1/speech/client.rb
##
# Performs bidirectional streaming speech recognition: receive results while
# sending audio. This method is only available via the gRPC API (not REST).
#
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeRequest, ::Hash>]
#   An enumerable of {::Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances.
# @param options [::Gapic::CallOptions, ::Hash]
#   Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>]
#
# @raise [::Google::Cloud::Error] if the RPC is aborted.
#
Performs bidirectional streaming speech recognition: receive results while
sending audio. This method is only available via the gRPC API (not REST).
Performs bidirectional streaming speech recognition : receive results while sending audio . This method is only available via the gRPC API ( not REST ) .
def streaming_recognize request, options = nil
              unless request.is_a? ::Enumerable
                raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
                request = request.to_enum
              end
              request = request.lazy.map do |req|
                ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Speech::V1::StreamingRecognizeRequest
              end
              options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
              metadata = @config.rpcs.streaming_recognize.metadata.to_h
              metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
                lib_name: @config.lib_name, lib_version: @config.lib_version,
                gapic_version: ::Google::Cloud::Speech::V1::VERSION
              metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
              options.apply_defaults timeout:      @config.rpcs.streaming_recognize.timeout,
                                     metadata:     metadata,
                                     retry_policy: @config.rpcs.streaming_recognize.retry_policy
              options.apply_defaults timeout:      @config.timeout,
                                     metadata:     @config.metadata,
                                     retry_policy: @config.retry_policy
              @speech_stub.call_rpc :streaming_recognize, request, options: options do |response, operation|
                yield response, operation if block_given?
                return response
              end
            rescue ::GRPC::BadStatus => e
              raise ::Google::Cloud::Error.from_error(e)
            end
def streaming_recognize request , options = nil unless request . is_a? :: Enumerable raise :: ArgumentError , "request must be an Enumerable" unless request . respond_to? :to_enum request = request . to_enum end request = request . lazy . map do | req | :: Gapic :: Protobuf . coerce req , to : :: Google :: Cloud :: Speech :: V1 :: StreamingRecognizeRequest end options = :: Gapic :: CallOptions . new ( ** options . to_h ) if options . respond_to? :to_h metadata = @config . rpcs . streaming_recognize . metadata . to_h metadata [ :" x-goog-api-client " ] ||= :: Gapic :: Headers . x_goog_api_client lib_name : @config . lib_name , lib_version : @config . lib_version , gapic_version : :: Google :: Cloud :: Speech :: V1 :: VERSION metadata [ :" x-goog-user-project " ] = @quota_project_id if @quota_project_id options . apply_defaults timeout : @config . rpcs . streaming_recognize . timeout , metadata : metadata , retry_policy : @config . rpcs . streaming_recognize . retry_policy options . apply_defaults timeout : @config . timeout , metadata : @config . metadata , retry_policy : @config . retry_policy @speech_stub . call_rpc :streaming_recognize , request , options : options do | response , operation | yield response , operation if block_given? return response end rescue :: GRPC :: BadStatus => e raise :: Google :: Cloud :: Error . from_error ( e ) end
Performs bidirectional streaming speech recognition: receive results while
sending audio.
Performs bidirectional streaming speech recognition : receive results while sending audio .
# Converts hash and nil to an options object # Customize the options with defaults # Set x-goog-api-client and x-goog-user-project headers
None
::Enumerable<::Google::Cloud::Speech::V1::StreamingRecognizeResponse>
[::Google::Cloud::Error] if the RPC is aborted.
[ :: Google :: Cloud :: Error ] if the RPC is aborted .
request
An enumerable of {::Google::Cloud::Speech::V1::StreamingRecognizeRequest} instances.
An enumerable of { :: Google :: Cloud :: Speech :: V1 :: StreamingRecognizeRequest } instances .
options
Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
Overrides the default settings for this call e . g timeout retries etc . Optional .
]
<not_specific>
Access the result along with the RPC operation
Access the result along with the RPC operation
<not_specific>
None