Class: Google::Apis::SpeechV1beta1::RecognitionAudio

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/speech_v1beta1/classes.rb,
generated/google/apis/speech_v1beta1/representations.rb,
generated/google/apis/speech_v1beta1/representations.rb

Overview

Contains audio data in the encoding specified in the RecognitionConfig. Either content or uri must be supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. See audio limits.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ RecognitionAudio

Returns a new instance of RecognitionAudio.



121
122
123
# File 'generated/google/apis/speech_v1beta1/classes.rb', line 121

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#contentString

The audio data bytes encoded as specified in RecognitionConfig. Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64. Corresponds to the JSON property content

Returns:

  • (String)


109
110
111
# File 'generated/google/apis/speech_v1beta1/classes.rb', line 109

def content
  @content
end

#uriString

URI that points to a file that contains audio data bytes as specified in RecognitionConfig. Currently, only Google Cloud Storage URIs are supported, which must be specified in the following format: gs://bucket_name/object_name (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see Request URIs. Corresponds to the JSON property uri

Returns:

  • (String)


119
120
121
# File 'generated/google/apis/speech_v1beta1/classes.rb', line 119

def uri
  @uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



126
127
128
129
# File 'generated/google/apis/speech_v1beta1/classes.rb', line 126

def update!(**args)
  @content = args[:content] if args.key?(:content)
  @uri = args[:uri] if args.key?(:uri)
end