pub struct GptSoVitsModel { /* private fields */ }
Implementations§
Source§impl GptSoVitsModel
impl GptSoVitsModel
Sourcepub fn new<P>(
sovits_path: P,
ssl_path: P,
t2s_encoder_path: P,
t2s_fs_decoder_path: P,
t2s_s_decoder_path: P,
bert_path: Option<P>,
g2pw_path: Option<P>,
g2p_en_path: Option<P>,
) -> Result<Self, GSVError>
pub fn new<P>( sovits_path: P, ssl_path: P, t2s_encoder_path: P, t2s_fs_decoder_path: P, t2s_s_decoder_path: P, bert_path: Option<P>, g2pw_path: Option<P>, g2p_en_path: Option<P>, ) -> Result<Self, GSVError>
create new tts instance bert_path, g2pw_path and g2p_en_path can be None if bert path is none, the speech speed in chinese may become worse if g2pw path is none, the chinese speech quality may be worse g2p_en is still experimental, english speak quality may not be better because of bugs
pub async fn get_reference_data<P, S>( &mut self, reference_audio_path: P, ref_text: S, lang_id: LangId, ) -> Result<ReferenceData, GSVError>
Sourcepub async fn synthesize<R, S>(
&mut self,
text: S,
reference_data: R,
sampling_param: SamplingParams,
lang_id: LangId,
) -> Result<impl Stream<Item = Result<Vec<f32>, GSVError>> + Send + Unpin, GSVError>
pub async fn synthesize<R, S>( &mut self, text: S, reference_data: R, sampling_param: SamplingParams, lang_id: LangId, ) -> Result<impl Stream<Item = Result<Vec<f32>, GSVError>> + Send + Unpin, GSVError>
synthesize async
text
is input text for run
lang_id
can be LangId::Auto(Mandarin) or LangId::AutoYue(cantonese)
Auto Trait Implementations§
impl !Freeze for GptSoVitsModel
impl !RefUnwindSafe for GptSoVitsModel
impl Send for GptSoVitsModel
impl Sync for GptSoVitsModel
impl Unpin for GptSoVitsModel
impl !UnwindSafe for GptSoVitsModel
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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