pub struct VVClient {
pub host: String,
pub port: i32,
pub speakers: Vec<Speaker>,
pub dct: HashMap<String, usize>,
pub hm: HashMap<i32, (usize, usize)>,
pub ac_tpl: Option<(AhoCorasick, Vec<String>)>,
pub words: BTreeMap<i32, (String, String)>,
pub words_file: String,
pub cfg_path: String,
pub stream_tpl: Option<(OutputStream, OutputStreamHandle)>,
pub sink: Option<Sink>,
}Expand description
VOICEVOX Client
Fields§
§host: Stringhost
port: i32port
speakers: Vec<Speaker>speakers
dct: HashMap<String, usize>dct (name, index)
hm: HashMap<i32, (usize, usize)>hm (speaker_id, (index of speakers, index of styles))
ac_tpl: Option<(AhoCorasick, Vec<String>)>ac_tpl
words: BTreeMap<i32, (String, String)>words (String, String)
words_file: Stringwords file
cfg_path: Stringcfg path
stream_tpl: Option<(OutputStream, OutputStreamHandle)>stream_tpl
sink: Option<Sink>sink
Implementations§
Source§impl VVClient
VOICEVOX Client implementation
impl VVClient
VOICEVOX Client implementation
Sourcepub fn load_words(&mut self) -> Result<(), Box<dyn Error>>
pub fn load_words(&mut self) -> Result<(), Box<dyn Error>>
load words (called inner constructor)
Sourcepub fn get_speakers(&mut self) -> Result<(), Box<dyn Error>>
pub fn get_speakers(&mut self) -> Result<(), Box<dyn Error>>
get speakers (called inner constructor)
Sourcepub fn style_name(&self, idx: (usize, usize)) -> &String
pub fn style_name(&self, idx: (usize, usize)) -> &String
get style name
Sourcepub fn detail_speaker(&self, id: i32) -> (bool, String)
pub fn detail_speaker(&self, id: i32) -> (bool, String)
detail speaker
Sourcepub fn query(&self, txt: &str, id: i32) -> Result<String, Box<dyn Error>>
pub fn query(&self, txt: &str, id: i32) -> Result<String, Box<dyn Error>>
audio query as string
Sourcepub fn phrases(&self, qs: &String) -> Result<Phrases, Box<dyn Error>>
pub fn phrases(&self, qs: &String) -> Result<Phrases, Box<dyn Error>>
audio query string to json object Phrases
Auto Trait Implementations§
impl !Freeze for VVClient
impl !RefUnwindSafe for VVClient
impl !Send for VVClient
impl !Sync for VVClient
impl Unpin for VVClient
impl !UnwindSafe for VVClient
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