Reference documentation and code samples for the Cloud Speech-to-Text V1 API class Google::Cloud::Speech::V1::RecognitionAudio.
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][google.rpc.Code.INVALID_ARGUMENT].
See content limits.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#content
defcontent()->::String
Returns
(::String) — The audio data bytes encoded as specified in
RecognitionConfig. Note: as with all bytes fields, proto buffers use a
pure binary representation, whereas JSON representations use base64.
Note: The following fields are mutually exclusive: content, uri. If a field in that set is populated, all other fields in the set will automatically be cleared.
#content=
defcontent=(value)->::String
Parameter
value (::String) — The audio data bytes encoded as specified in
RecognitionConfig. Note: as with all bytes fields, proto buffers use a
pure binary representation, whereas JSON representations use base64.
Note: The following fields are mutually exclusive: content, uri. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — The audio data bytes encoded as specified in
RecognitionConfig. Note: as with all bytes fields, proto buffers use a
pure binary representation, whereas JSON representations use base64.
Note: The following fields are mutually exclusive: content, uri. If a field in that set is populated, all other fields in the set will automatically be cleared.
#uri
defuri()->::String
Returns
(::String) — URI that points to a file that contains audio data bytes as specified in
RecognitionConfig. The file must not be compressed (for example, gzip).
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][google.rpc.Code.INVALID_ARGUMENT]).
For more information, see Request
URIs.
Note: The following fields are mutually exclusive: uri, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
#uri=
defuri=(value)->::String
Parameter
value (::String) — URI that points to a file that contains audio data bytes as specified in
RecognitionConfig. The file must not be compressed (for example, gzip).
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][google.rpc.Code.INVALID_ARGUMENT]).
For more information, see Request
URIs.
Note: The following fields are mutually exclusive: uri, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
Returns
(::String) — URI that points to a file that contains audio data bytes as specified in
RecognitionConfig. The file must not be compressed (for example, gzip).
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][google.rpc.Code.INVALID_ARGUMENT]).
For more information, see Request
URIs.
Note: The following fields are mutually exclusive: uri, content. If a field in that set is populated, all other fields in the set will automatically be cleared.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Cloud Speech-to-Text V1 API - Class Google::Cloud::Speech::V1::RecognitionAudio (v1.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.0 (latest)](/ruby/docs/reference/google-cloud-speech-v1/latest/Google-Cloud-Speech-V1-RecognitionAudio)\n- [1.2.1](/ruby/docs/reference/google-cloud-speech-v1/1.2.1/Google-Cloud-Speech-V1-RecognitionAudio)\n- [1.1.0](/ruby/docs/reference/google-cloud-speech-v1/1.1.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [1.0.1](/ruby/docs/reference/google-cloud-speech-v1/1.0.1/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.17.0](/ruby/docs/reference/google-cloud-speech-v1/0.17.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.16.2](/ruby/docs/reference/google-cloud-speech-v1/0.16.2/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.15.0](/ruby/docs/reference/google-cloud-speech-v1/0.15.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.14.0](/ruby/docs/reference/google-cloud-speech-v1/0.14.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.13.1](/ruby/docs/reference/google-cloud-speech-v1/0.13.1/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.12.1](/ruby/docs/reference/google-cloud-speech-v1/0.12.1/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.11.0](/ruby/docs/reference/google-cloud-speech-v1/0.11.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.10.2](/ruby/docs/reference/google-cloud-speech-v1/0.10.2/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.9.0](/ruby/docs/reference/google-cloud-speech-v1/0.9.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.8.0](/ruby/docs/reference/google-cloud-speech-v1/0.8.0/Google-Cloud-Speech-V1-RecognitionAudio)\n- [0.7.3](/ruby/docs/reference/google-cloud-speech-v1/0.7.3/Google-Cloud-Speech-V1-RecognitionAudio) \nReference documentation and code samples for the Cloud Speech-to-Text V1 API class Google::Cloud::Speech::V1::RecognitionAudio.\n\nContains audio data in the encoding specified in the `RecognitionConfig`.\nEither `content` or `uri` must be supplied. Supplying both or neither\nreturns \\[google.rpc.Code.INVALID_ARGUMENT\\]\\[google.rpc.Code.INVALID_ARGUMENT\\].\nSee [content limits](https://cloud.google.com/speech-to-text/quotas#content). \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #content\n\n def content() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.\n\n\n Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #content=\n\n def content=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.\n\n\nNote: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- The audio data bytes encoded as specified in `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64.\n\n\n Note: The following fields are mutually exclusive: `content`, `uri`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #uri\n\n def uri() -\u003e ::String\n\n**Returns**\n\n- (::String) --- URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). 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\\]\\[google.rpc.Code.INVALID_ARGUMENT\\]). For more information, see [Request\n URIs](https://cloud.google.com/storage/docs/reference-uris).\n\n\n Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared.\n\n### #uri=\n\n def uri=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). 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\\]\\[google.rpc.Code.INVALID_ARGUMENT\\]). For more information, see [Request\n URIs](https://cloud.google.com/storage/docs/reference-uris).\n\n\nNote: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. \n**Returns**\n\n- (::String) --- URI that points to a file that contains audio data bytes as specified in `RecognitionConfig`. The file must not be compressed (for example, gzip). 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\\]\\[google.rpc.Code.INVALID_ARGUMENT\\]). For more information, see [Request\n URIs](https://cloud.google.com/storage/docs/reference-uris).\n\n\n Note: The following fields are mutually exclusive: `uri`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared."]]