pub struct DialogueRequest<'a> { /* private fields */ }Expand description
A request to speak a dialogue of several voices, made by
SpeechGenerator::generate_dialogue and sent by awaiting it.
Implementations§
Source§impl<'a> DialogueRequest<'a>
impl<'a> DialogueRequest<'a>
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Sets the model for this call, instead of the dialogue model of the provider.
Sourcepub fn with_format(self, format: AudioFormat) -> Self
pub fn with_format(self, format: AudioFormat) -> Self
Sets the output format.
Sourcepub fn with_speed(self, speed: f64) -> Self
pub fn with_speed(self, speed: f64) -> Self
Sets the speaking speed of every turn. A provider that cannot set it for a dialogue
returns AudioError::Unsupported.
Sourcepub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
Sets the language of the text.
Sourcepub fn with_timestamps(self, timestamps: bool) -> Self
pub fn with_timestamps(self, timestamps: bool) -> Self
Asks for the time of every word in SpeechResponse::timestamps. A provider that
cannot give them returns AudioError::Unsupported.
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Sets the file name of the audio, set as its Media::name. Never sent to the provider.
Sourcepub fn voices(&self) -> &[VoiceId]
pub fn voices(&self) -> &[VoiceId]
The distinct voices, in the order they first speak. A voice’s index is its speaker
number in turns.
Sourcepub fn turns(&self) -> &[(usize, String)]
pub fn turns(&self) -> &[(usize, String)]
Every turn as the index of its voice in voices and its text.
Sourcepub fn format(&self) -> Option<AudioFormat>
pub fn format(&self) -> Option<AudioFormat>
The output format, if set.
Sourcepub fn timestamps(&self) -> bool
pub fn timestamps(&self) -> bool
Whether the time of every word is asked for.