pub struct TranslateSpeechConfig {
pub audio_encoding: String,
pub source_language_code: String,
pub target_language_code: String,
pub sample_rate_hertz: i32,
pub model: String,
}
Expand description
Provides information to the speech translation that specifies how to process the request.
Fields§
§audio_encoding: 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 oflinear16
. -
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.
source_language_code: String
Required. Source language code (BCP-47) of the input audio.
target_language_code: String
Required. Target language code (BCP-47) of the output.
sample_rate_hertz: i32
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).
model: 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.
Trait Implementations§
source§impl Clone for TranslateSpeechConfig
impl Clone for TranslateSpeechConfig
source§fn clone(&self) -> TranslateSpeechConfig
fn clone(&self) -> TranslateSpeechConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TranslateSpeechConfig
impl Debug for TranslateSpeechConfig
source§impl Default for TranslateSpeechConfig
impl Default for TranslateSpeechConfig
source§impl Message for TranslateSpeechConfig
impl Message for TranslateSpeechConfig
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for TranslateSpeechConfig
impl PartialEq for TranslateSpeechConfig
source§fn eq(&self, other: &TranslateSpeechConfig) -> bool
fn eq(&self, other: &TranslateSpeechConfig) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TranslateSpeechConfig
Auto Trait Implementations§
impl Freeze for TranslateSpeechConfig
impl RefUnwindSafe for TranslateSpeechConfig
impl Send for TranslateSpeechConfig
impl Sync for TranslateSpeechConfig
impl Unpin for TranslateSpeechConfig
impl UnwindSafe for TranslateSpeechConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request