Skip to main content

SpeechProfile

Struct SpeechProfile 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: bool

Designs a voice from a description.

§instructions: bool

Takes 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: bool

Takes raw engine input with no template (such as Kokoro phonemes).

§speed: bool

Takes a speaking speed.

§streaming: bool

Streams 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

Source

pub fn new() -> Self

Source

pub fn with_presets<S: Into<String>>( self, presets: impl IntoIterator<Item = S>, ) -> Self

Source

pub fn with_design(self, design: bool) -> Self

Source

pub fn with_instructions(self, instructions: bool) -> Self

Source

pub fn with_clone(self, clone: CloneMode) -> Self

Source

pub fn with_script_speakers(self, speakers: u8) -> Self

Source

pub fn with_max_voices(self, voices: u8) -> Self

Source

pub fn with_raw(self, raw: bool) -> Self

Source

pub fn with_speed(self, speed: bool) -> Self

Source

pub fn with_streaming(self, streaming: bool) -> Self

Source

pub fn with_languages<S: Into<String>>( self, languages: impl IntoIterator<Item = S>, ) -> Self

Source

pub fn with_formats( self, formats: impl IntoIterator<Item = AudioFormat>, ) -> Self

The output formats, the default first.

Source

pub fn with_sample_rate(self, hz: u32) -> Self

Source

pub fn with_max_input_chars(self, chars: u32) -> Self

Source

pub fn with_max_reference_seconds(self, seconds: u32) -> Self

Source

pub fn with_max_reference_bytes(self, bytes: u64) -> Self

Source

pub fn with_max_output_seconds(self, seconds: u32) -> Self

Source

pub fn with_license(self, license: impl Into<String>) -> Self

Source

pub fn is_unknown(&self) -> bool

Nothing is reported (every field unset).

Source

pub fn default_format(&self) -> Option<AudioFormat>

The format a request without one gets: the first reported.

Source

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.

Trait Implementations§

Source§

impl Clone for SpeechProfile

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpeechProfile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SpeechProfile

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SpeechProfile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for SpeechProfile

Source§

impl PartialEq for SpeechProfile

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SpeechProfile

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SpeechProfile

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.