#[non_exhaustive]pub struct SpeechProfile {Show 17 fields
pub presets: Option<Vec<String>>,
pub design: bool,
pub instructions: bool,
pub clone: Option<CloneMode>,
pub script_speakers: Option<u8>,
pub max_voices: Option<u8>,
pub raw: bool,
pub speed: bool,
pub streaming: bool,
pub languages: Option<Vec<String>>,
pub formats: Vec<AudioFormat>,
pub sample_rate: Option<u32>,
pub max_input_chars: Option<u32>,
pub max_reference_seconds: Option<u32>,
pub max_reference_bytes: Option<u64>,
pub max_output_seconds: Option<u32>,
pub license: Option<String>,
}Expand description
What one speaking model does, takes and allows. See the module docs; the fields are
those of weirdnet_agent::speech::SpeechProfile, with the same names on the wire.
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.presets: Option<Vec<String>>The named preset voices, the model’s default first when known. None: the model takes no
preset by name (or none was reported).
design: boolDesigns a voice from a description.
instructions: boolTakes style or emotion instructions for the chosen voice.
clone: Option<CloneMode>Clones a voice from a reference clip, and what the clip needs.
script_speakers: Option<u8>Speaks multi-speaker scripts with up to this many speakers (speaker numbers below it).
max_voices: Option<u8>Most voices one request may set (the voice plus per-speaker voices).
raw: boolTakes raw engine input with no template (such as Kokoro phonemes).
speed: boolTakes a speaking speed.
streaming: boolStreams audio as it is made.
languages: Option<Vec<String>>The languages it speaks from text (ISO 639-1 or the engine’s codes). None: not reported.
formats: Vec<AudioFormat>The output formats it produces, the default first. Empty: not reported.
sample_rate: Option<u32>Its output sample rate in Hz.
max_input_chars: Option<u32>Longest input in characters one request may carry.
max_reference_seconds: Option<u32>Longest reference clip in seconds (what the engine uses of a longer one).
max_reference_bytes: Option<u64>Largest reference clip in bytes.
max_output_seconds: Option<u32>Longest audio one request produces, in seconds.
license: Option<String>The model’s license when it restricts how speech may be served, such as
FISH_AUDIO_COMMUNITY.
Implementations§
Source§impl SpeechProfile
impl SpeechProfile
pub fn new() -> Self
pub fn with_presets<S: Into<String>>( self, presets: impl IntoIterator<Item = S>, ) -> Self
pub fn with_design(self, design: bool) -> Self
pub fn with_instructions(self, instructions: bool) -> Self
pub fn with_clone(self, clone: CloneMode) -> Self
pub fn with_script_speakers(self, speakers: u8) -> Self
pub fn with_max_voices(self, voices: u8) -> Self
pub fn with_raw(self, raw: bool) -> Self
pub fn with_speed(self, speed: bool) -> Self
pub fn with_streaming(self, streaming: bool) -> Self
pub fn with_languages<S: Into<String>>( self, languages: impl IntoIterator<Item = S>, ) -> Self
Sourcepub fn with_formats(
self,
formats: impl IntoIterator<Item = AudioFormat>,
) -> Self
pub fn with_formats( self, formats: impl IntoIterator<Item = AudioFormat>, ) -> Self
The output formats, the default first.
pub fn with_sample_rate(self, hz: u32) -> Self
pub fn with_max_input_chars(self, chars: u32) -> Self
pub fn with_max_reference_seconds(self, seconds: u32) -> Self
pub fn with_max_reference_bytes(self, bytes: u64) -> Self
pub fn with_max_output_seconds(self, seconds: u32) -> Self
pub fn with_license(self, license: impl Into<String>) -> Self
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Nothing is reported (every field unset).
Sourcepub fn default_format(&self) -> Option<AudioFormat>
pub fn default_format(&self) -> Option<AudioFormat>
The format a request without one gets: the first reported.
Sourcepub fn or(&self, fallback: &Self) -> Self
pub fn or(&self, fallback: &Self) -> Self
Each field from self when it is set, else from fallback: what an engine reports at
load over a catalog entry or a header (reported.or(&cataloged)). A bool is set when it is
true; empty formats count as unset. Nothing here narrows: operator overrides go through
weirdnet_agent::speech::SpeechProfile::narrowed_by.