Reference documentation and code samples for the Media Translation V1beta1 API class Google::Cloud::MediaTranslation::V1beta1::TranslateSpeechConfig.
Provides information to the speech translation that specifies how to process
the request.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#audio_encoding
defaudio_encoding()->::String
Returns
(::String) — Required. Encoding of audio data.
Supported formats:
linear16
Uncompressed 16-bit signed little-endian samples (Linear PCM).
flac
flac (Free Lossless Audio Codec) is the recommended encoding
because it is lossless--therefore recognition is not compromised--and
requires only about half the bandwidth of linear16.
mulaw
8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
amr
Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.
amr-wb
Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.
ogg-opus
Opus encoded audio frames in Ogg
container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000,
or 48000.
mp3
MP3 audio. Support all standard MP3 bitrates (which range from 32-320
kbps). When using this encoding, sample_rate_hertz has to match the
sample rate of the file being used.
#audio_encoding=
defaudio_encoding=(value)->::String
Parameter
value (::String) — Required. Encoding of audio data.
Supported formats:
linear16
Uncompressed 16-bit signed little-endian samples (Linear PCM).
flac
flac (Free Lossless Audio Codec) is the recommended encoding
because it is lossless--therefore recognition is not compromised--and
requires only about half the bandwidth of linear16.
mulaw
8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
amr
Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.
amr-wb
Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.
ogg-opus
Opus encoded audio frames in Ogg
container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000,
or 48000.
mp3
MP3 audio. Support all standard MP3 bitrates (which range from 32-320
kbps). When using this encoding, sample_rate_hertz has to match the
sample rate of the file being used.
Returns
(::String) — Required. Encoding of audio data.
Supported formats:
linear16
Uncompressed 16-bit signed little-endian samples (Linear PCM).
flac
flac (Free Lossless Audio Codec) is the recommended encoding
because it is lossless--therefore recognition is not compromised--and
requires only about half the bandwidth of linear16.
mulaw
8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
amr
Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.
amr-wb
Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.
ogg-opus
Opus encoded audio frames in Ogg
container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000,
or 48000.
mp3
MP3 audio. Support all standard MP3 bitrates (which range from 32-320
kbps). When using this encoding, sample_rate_hertz has to match the
sample rate of the file being used.
#model
defmodel()->::String
Returns
(::String) — Optional. google-provided-model/video and
google-provided-model/enhanced-phone-call are premium models.
google-provided-model/phone-call is not premium model.
#model=
defmodel=(value)->::String
Parameter
value (::String) — Optional. google-provided-model/video and
google-provided-model/enhanced-phone-call are premium models.
google-provided-model/phone-call is not premium model.
Returns
(::String) — Optional. google-provided-model/video and
google-provided-model/enhanced-phone-call are premium models.
google-provided-model/phone-call is not premium model.
#sample_rate_hertz
defsample_rate_hertz()->::Integer
Returns
(::Integer) — Optional. Sample rate in Hertz of the audio data. Valid values are:
8000-48000. 16000 is optimal. For best results, set the sampling rate of
the audio source to 16000 Hz. If that's not possible, use the native sample
rate of the audio source (instead of re-sampling).
#sample_rate_hertz=
defsample_rate_hertz=(value)->::Integer
Parameter
value (::Integer) — Optional. Sample rate in Hertz of the audio data. Valid values are:
8000-48000. 16000 is optimal. For best results, set the sampling rate of
the audio source to 16000 Hz. If that's not possible, use the native sample
rate of the audio source (instead of re-sampling).
Returns
(::Integer) — Optional. Sample rate in Hertz of the audio data. Valid values are:
8000-48000. 16000 is optimal. For best results, set the sampling rate of
the audio source to 16000 Hz. If that's not possible, use the native sample
rate of the audio source (instead of re-sampling).
#source_language_code
defsource_language_code()->::String
Returns
(::String) — Required. Source language code (BCP-47) of the input audio.
#source_language_code=
defsource_language_code=(value)->::String
Parameter
value (::String) — Required. Source language code (BCP-47) of the input audio.
Returns
(::String) — Required. Source language code (BCP-47) of the input audio.
#target_language_code
deftarget_language_code()->::String
Returns
(::String) — Required. Target language code (BCP-47) of the output.
#target_language_code=
deftarget_language_code=(value)->::String
Parameter
value (::String) — Required. Target language code (BCP-47) of the output.
Returns
(::String) — Required. Target language code (BCP-47) of the output.
[[["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-09-09 UTC."],[],[],null,["# Media Translation V1beta1 API - Class Google::Cloud::MediaTranslation::V1beta1::TranslateSpeechConfig (v0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.11.1](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.11.1/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.10.0](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.10.0/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.9.1](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.9.1/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.8.2](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.8.2/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.7.0](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.7.0/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.6.1](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.6.1/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.5.0](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.5.0/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig)\n- [0.4.5](/ruby/docs/reference/google-cloud-media_translation-v1beta1/0.4.5/Google-Cloud-MediaTranslation-V1beta1-TranslateSpeechConfig) \nReference documentation and code samples for the Media Translation V1beta1 API class Google::Cloud::MediaTranslation::V1beta1::TranslateSpeechConfig.\n\nProvides information to the speech translation that specifies how to process\nthe request. \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### #audio_encoding\n\n def audio_encoding() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Encoding of audio data. Supported formats:\n\n - `linear16`\n\n Uncompressed 16-bit signed little-endian samples (Linear PCM).\n - `flac`\n\n `flac` (Free Lossless Audio Codec) is the recommended encoding\n because it is lossless--therefore recognition is not compromised--and\n requires only about half the bandwidth of `linear16`.\n - `mulaw`\n\n 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.\n - `amr`\n\n Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.\n - `amr-wb`\n\n Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.\n - `ogg-opus`\n\n Opus encoded audio frames in [Ogg](https://wikipedia.org/wiki/Ogg)\n container. `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000,\n or 48000.\n - `mp3`\n\n MP3 audio. Support all standard MP3 bitrates (which range from 32-320\n kbps). When using this encoding, `sample_rate_hertz` has to match the\n sample rate of the file being used.\n\n### #audio_encoding=\n\n def audio_encoding=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Encoding of audio data. Supported formats:\n\n\n - `linear16`\n\n Uncompressed 16-bit signed little-endian samples (Linear PCM).\n - `flac`\n\n `flac` (Free Lossless Audio Codec) is the recommended encoding\n because it is lossless--therefore recognition is not compromised--and\n requires only about half the bandwidth of `linear16`.\n - `mulaw`\n\n 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.\n - `amr`\n\n Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.\n - `amr-wb`\n\n Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.\n - `ogg-opus`\n\n Opus encoded audio frames in [Ogg](https://wikipedia.org/wiki/Ogg)\n container. `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000,\n or 48000.\n - `mp3`\n\n MP3 audio. Support all standard MP3 bitrates (which range from 32-320\n kbps). When using this encoding, `sample_rate_hertz` has to match the\nsample rate of the file being used. \n**Returns**\n\n- (::String) --- Required. Encoding of audio data. Supported formats:\n\n - `linear16`\n\n Uncompressed 16-bit signed little-endian samples (Linear PCM).\n - `flac`\n\n `flac` (Free Lossless Audio Codec) is the recommended encoding\n because it is lossless--therefore recognition is not compromised--and\n requires only about half the bandwidth of `linear16`.\n - `mulaw`\n\n 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.\n - `amr`\n\n Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.\n - `amr-wb`\n\n Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.\n - `ogg-opus`\n\n Opus encoded audio frames in [Ogg](https://wikipedia.org/wiki/Ogg)\n container. `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000,\n or 48000.\n - `mp3`\n\n MP3 audio. Support all standard MP3 bitrates (which range from 32-320\n kbps). When using this encoding, `sample_rate_hertz` has to match the\n sample rate of the file being used.\n\n### #model\n\n def model() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. `google-provided-model/video` and `google-provided-model/enhanced-phone-call` are premium models. `google-provided-model/phone-call` is not premium model.\n\n### #model=\n\n def model=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. `google-provided-model/video` and `google-provided-model/enhanced-phone-call` are premium models. `google-provided-model/phone-call` is not premium model. \n**Returns**\n\n- (::String) --- Optional. `google-provided-model/video` and `google-provided-model/enhanced-phone-call` are premium models. `google-provided-model/phone-call` is not premium model.\n\n### #sample_rate_hertz\n\n def sample_rate_hertz() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- Optional. Sample rate in Hertz of the audio data. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling).\n\n### #sample_rate_hertz=\n\n def sample_rate_hertz=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- Optional. Sample rate in Hertz of the audio data. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling). \n**Returns**\n\n- (::Integer) --- Optional. Sample rate in Hertz of the audio data. Valid values are: 8000-48000. 16000 is optimal. For best results, set the sampling rate of the audio source to 16000 Hz. If that's not possible, use the native sample rate of the audio source (instead of re-sampling).\n\n### #source_language_code\n\n def source_language_code() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Source language code (BCP-47) of the input audio.\n\n### #source_language_code=\n\n def source_language_code=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Source language code (BCP-47) of the input audio. \n**Returns**\n\n- (::String) --- Required. Source language code (BCP-47) of the input audio.\n\n### #target_language_code\n\n def target_language_code() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Target language code (BCP-47) of the output.\n\n### #target_language_code=\n\n def target_language_code=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Target language code (BCP-47) of the output. \n**Returns**\n\n- (::String) --- Required. Target language code (BCP-47) of the output."]]