From d7c6f11c65388fc152617361512f07ddc3421618 Mon Sep 17 00:00:00 2001 From: tuna2134 Date: Wed, 11 Sep 2024 04:50:00 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20add=20=E6=94=B9=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sbv2_core/src/tts.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbv2_core/src/tts.rs b/sbv2_core/src/tts.rs index dad322f..5a8c454 100644 --- a/sbv2_core/src/tts.rs +++ b/sbv2_core/src/tts.rs @@ -48,9 +48,11 @@ impl TTSModelHolder { tokenizer, }) } + pub fn models(&self) -> Vec { self.models.iter().map(|m| m.ident.to_string()).collect() } + pub fn load, P: AsRef<[u8]>>( &mut self, ident: I, @@ -67,6 +69,7 @@ impl TTSModelHolder { } Ok(()) } + pub fn unload>(&mut self, ident: I) -> bool { let ident = ident.into(); if let Some((i, _)) = self @@ -81,6 +84,7 @@ impl TTSModelHolder { false } } + #[allow(clippy::type_complexity)] pub fn parse_text( &self, @@ -143,6 +147,7 @@ impl TTSModelHolder { lang_ids.into(), )) } + fn find_model>(&self, ident: I) -> Result<&TTSModel> { let ident = ident.into(); self.models @@ -159,6 +164,7 @@ impl TTSModelHolder { ) -> Result> { style::get_style_vector(&self.find_model(ident)?.style_vectors, style_id, weight) } + #[allow(clippy::too_many_arguments)] pub fn synthesize>( &self,