#[non_exhaustive]pub struct TextToSpeechSettings {
pub enable_text_to_speech: bool,
pub output_audio_encoding: OutputAudioEncoding,
pub sample_rate_hertz: i32,
pub synthesize_speech_configs: HashMap<String, SynthesizeSpeechConfig>,
/* private fields */
}environments only.Expand description
Instructs the speech synthesizer on how to generate the output audio content.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enable_text_to_speech: boolOptional. Indicates whether text to speech is enabled. Even when this field is false, other settings in this proto are still retained.
output_audio_encoding: OutputAudioEncodingRequired. Audio encoding of the synthesized audio content.
sample_rate_hertz: i32Optional. The synthesis sample rate (in hertz) for this audio. If not provided, then the synthesizer will use the default sample rate based on the audio encoding. If this is different from the voice’s natural sample rate, then the synthesizer will honor this request by converting to the desired sample rate (which might result in worse audio quality).
synthesize_speech_configs: HashMap<String, SynthesizeSpeechConfig>Optional. Configuration of how speech should be synthesized, mapping from language (https://cloud.google.com/dialogflow/docs/reference/language) to SynthesizeSpeechConfig.
Implementations§
Source§impl TextToSpeechSettings
impl TextToSpeechSettings
pub fn new() -> Self
Sourcepub fn set_enable_text_to_speech<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_text_to_speech<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_text_to_speech.
§Example
let x = TextToSpeechSettings::new().set_enable_text_to_speech(true);Sourcepub fn set_output_audio_encoding<T: Into<OutputAudioEncoding>>(
self,
v: T,
) -> Self
pub fn set_output_audio_encoding<T: Into<OutputAudioEncoding>>( self, v: T, ) -> Self
Sets the value of output_audio_encoding.
§Example
use google_cloud_dialogflow_v2::model::OutputAudioEncoding;
let x0 = TextToSpeechSettings::new().set_output_audio_encoding(OutputAudioEncoding::Linear16);
let x1 = TextToSpeechSettings::new().set_output_audio_encoding(OutputAudioEncoding::Mp3);
let x2 = TextToSpeechSettings::new().set_output_audio_encoding(OutputAudioEncoding::Mp364Kbps);Sourcepub fn set_sample_rate_hertz<T: Into<i32>>(self, v: T) -> Self
pub fn set_sample_rate_hertz<T: Into<i32>>(self, v: T) -> Self
Sets the value of sample_rate_hertz.
§Example
let x = TextToSpeechSettings::new().set_sample_rate_hertz(42);Sourcepub fn set_synthesize_speech_configs<T, K, V>(self, v: T) -> Self
pub fn set_synthesize_speech_configs<T, K, V>(self, v: T) -> Self
Sets the value of synthesize_speech_configs.
§Example
use google_cloud_dialogflow_v2::model::SynthesizeSpeechConfig;
let x = TextToSpeechSettings::new().set_synthesize_speech_configs([
("key0", SynthesizeSpeechConfig::default()/* use setters */),
("key1", SynthesizeSpeechConfig::default()/* use (different) setters */),
]);Trait Implementations§
Source§impl Clone for TextToSpeechSettings
impl Clone for TextToSpeechSettings
Source§fn clone(&self) -> TextToSpeechSettings
fn clone(&self) -> TextToSpeechSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more