public final class TranslateSpeechConfig extends GeneratedMessageV3 implements TranslateSpeechConfigOrBuilder
Provides information to the speech translation that specifies how to process
the request.
Protobuf type google.cloud.mediatranslation.v1beta1.TranslateSpeechConfig
Static Fields
public static final int AUDIO_ENCODING_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
public static final int MODEL_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
public static final int SOURCE_LANGUAGE_CODE_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
public static final int TARGET_LANGUAGE_CODE_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
Static Methods
public static TranslateSpeechConfig getDefaultInstance()
public static final Descriptors.Descriptor getDescriptor()
public static TranslateSpeechConfig.Builder newBuilder()
public static TranslateSpeechConfig.Builder newBuilder(TranslateSpeechConfig prototype)
public static TranslateSpeechConfig parseDelimitedFrom(InputStream input)
public static TranslateSpeechConfig parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static TranslateSpeechConfig parseFrom(byte[] data)
Parameter |
---|
Name | Description |
data | byte[]
|
public static TranslateSpeechConfig parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static TranslateSpeechConfig parseFrom(ByteString data)
public static TranslateSpeechConfig parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static TranslateSpeechConfig parseFrom(CodedInputStream input)
public static TranslateSpeechConfig parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static TranslateSpeechConfig parseFrom(InputStream input)
public static TranslateSpeechConfig parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static TranslateSpeechConfig parseFrom(ByteBuffer data)
public static TranslateSpeechConfig parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Parser<TranslateSpeechConfig> parser()
Methods
public boolean equals(Object obj)
Parameter |
---|
Name | Description |
obj | Object
|
Overrides
public String getAudioEncoding()
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.
string audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
Returns |
---|
Type | Description |
String | The audioEncoding.
|
public ByteString getAudioEncodingBytes()
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.
string audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
Returns |
---|
Type | Description |
ByteString | The bytes for audioEncoding.
|
public TranslateSpeechConfig getDefaultInstanceForType()
Optional. google-provided-model/video
and
google-provided-model/enhanced-phone-call
are premium models.
google-provided-model/phone-call
is not premium model.
string model = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns |
---|
Type | Description |
String | The model.
|
public ByteString getModelBytes()
Optional. google-provided-model/video
and
google-provided-model/enhanced-phone-call
are premium models.
google-provided-model/phone-call
is not premium model.
string model = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns |
---|
Type | Description |
ByteString | The bytes for model.
|
public Parser<TranslateSpeechConfig> getParserForType()
Overrides
public int getSampleRateHertz()
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).
int32 sample_rate_hertz = 4 [(.google.api.field_behavior) = OPTIONAL];
Returns |
---|
Type | Description |
int | The sampleRateHertz.
|
public int getSerializedSize()
Returns |
---|
Type | Description |
int | |
Overrides
public String getSourceLanguageCode()
Required. Source language code (BCP-47) of the input audio.
string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
Returns |
---|
Type | Description |
String | The sourceLanguageCode.
|
public ByteString getSourceLanguageCodeBytes()
Required. Source language code (BCP-47) of the input audio.
string source_language_code = 2 [(.google.api.field_behavior) = REQUIRED];
Returns |
---|
Type | Description |
ByteString | The bytes for sourceLanguageCode.
|
public String getTargetLanguageCode()
Required. Target language code (BCP-47) of the output.
string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
Returns |
---|
Type | Description |
String | The targetLanguageCode.
|
public ByteString getTargetLanguageCodeBytes()
Required. Target language code (BCP-47) of the output.
string target_language_code = 3 [(.google.api.field_behavior) = REQUIRED];
Returns |
---|
Type | Description |
ByteString | The bytes for targetLanguageCode.
|
public final UnknownFieldSet getUnknownFields()
Overrides
Returns |
---|
Type | Description |
int | |
Overrides
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
public final boolean isInitialized()
Overrides
public TranslateSpeechConfig.Builder newBuilderForType()
protected TranslateSpeechConfig.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Overrides
public TranslateSpeechConfig.Builder toBuilder()
public void writeTo(CodedOutputStream output)
Overrides