pub struct SynthesisResult {
pub audio: Vec<f32>,
pub sample_rate: u32,
pub duration: f32,
pub mel_spectrogram: Option<Vec<Vec<f32>>>,
pub alignment: Option<Vec<AlignmentInfo>>,
pub phonemes: Option<Vec<String>>,
}Expand description
Synthesis result containing audio and metadata.
Fields§
§audio: Vec<f32>Synthesized audio samples (mono)
sample_rate: u32Sample rate
duration: f32Duration in seconds
mel_spectrogram: Option<Vec<Vec<f32>>>Mel spectrogram (n_mels x frames)
alignment: Option<Vec<AlignmentInfo>>Alignment info (if available)
phonemes: Option<Vec<String>>Phoneme sequence (if available)
Implementations§
Source§impl SynthesisResult
impl SynthesisResult
Sourcepub fn with_alignment(&mut self, alignment: Vec<AlignmentInfo>)
pub fn with_alignment(&mut self, alignment: Vec<AlignmentInfo>)
Set alignment info
Sourcepub fn with_phonemes(&mut self, phonemes: Vec<String>)
pub fn with_phonemes(&mut self, phonemes: Vec<String>)
Set phoneme sequence
Sourcepub fn num_samples(&self) -> usize
pub fn num_samples(&self) -> usize
Get number of samples
Trait Implementations§
Source§impl Clone for SynthesisResult
impl Clone for SynthesisResult
Source§fn clone(&self) -> SynthesisResult
fn clone(&self) -> SynthesisResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SynthesisResult
impl RefUnwindSafe for SynthesisResult
impl Send for SynthesisResult
impl Sync for SynthesisResult
impl Unpin for SynthesisResult
impl UnsafeUnpin for SynthesisResult
impl UnwindSafe for SynthesisResult
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more