pub struct TtsStyle { /* private fields */ }Expand description
Text-to-speech style control.
Use the <style> tag to control the overall style of the synthesized audio.
The style should be placed at the beginning of the text to be synthesized.
Implementations§
Source§impl TtsStyle
impl TtsStyle
Sourcepub fn with_style(self, style: impl Into<String>) -> Self
pub fn with_style(self, style: impl Into<String>) -> Self
Add a style to apply.
§Available Styles
- Speed control: “变快”, “变慢”
- Emotion: “开心”, “悲伤”, “生气”
- Role play: “孙悟空”, “林黛玉”
- Style change: “悄悄话”, “夹子音”, “台湾腔”
- Dialect: “东北话”, “四川话”, “河南话”, “粤语”
- Singing: “唱歌”
§Example
use mimo_api::TtsStyle;
let style = TtsStyle::new()
.with_style("开心")
.with_style("变快");
let text = style.apply("明天就是周五了,真开心!");
assert!(text.starts_with("<style>"));Trait Implementations§
Auto Trait Implementations§
impl Freeze for TtsStyle
impl RefUnwindSafe for TtsStyle
impl Send for TtsStyle
impl Sync for TtsStyle
impl Unpin for TtsStyle
impl UnsafeUnpin for TtsStyle
impl UnwindSafe for TtsStyle
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