mirror of https://github.com/ndarilek/tts-rs.git
Use new Tolk library and update backend.
This commit is contained in:
parent
04c066d7e0
commit
1c1f38b55d
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "tts"
|
name = "tts"
|
||||||
version = "0.1.1"
|
version = "0.2.0"
|
||||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||||
repository = "https://gitlab.com/ndarilek/tts-rs"
|
repository = "https://gitlab.com/ndarilek/tts-rs"
|
||||||
description = "High-level Text-To-Speech (TTS) interface"
|
description = "High-level Text-To-Speech (TTS) interface"
|
||||||
|
@ -16,7 +16,7 @@ log = "0.4"
|
||||||
env_logger = "0.6"
|
env_logger = "0.6"
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
tolk = { git = "https://github.com/ndarilek/tolk-rs" }
|
tolk = "0.2"
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
speech-dispatcher = "0.3"
|
speech-dispatcher = "0.3"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use std::io;
|
||||||
use std::u8;
|
use std::u8;
|
||||||
|
|
||||||
use tts::*;
|
use tts::*;
|
||||||
|
@ -35,5 +36,7 @@ fn main() -> Result<(), std::io::Error> {
|
||||||
tts.set_volume(original_volume)?;
|
tts.set_volume(original_volume)?;
|
||||||
}
|
}
|
||||||
tts.speak("Goodbye.", false)?;
|
tts.speak("Goodbye.", false)?;
|
||||||
|
let mut _input = String::new();
|
||||||
|
io::stdin().read_line(&mut _input)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ impl Tolk {
|
||||||
pub fn new() -> impl Backend {
|
pub fn new() -> impl Backend {
|
||||||
info!("Initializing Tolk backend");
|
info!("Initializing Tolk backend");
|
||||||
let tolk = TolkPtr::new();
|
let tolk = TolkPtr::new();
|
||||||
|
tolk.try_sapi(true);
|
||||||
Tolk(tolk)
|
Tolk(tolk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +18,7 @@ impl Tolk {
|
||||||
impl Backend for Tolk {
|
impl Backend for Tolk {
|
||||||
fn supported_features(&self) -> Features {
|
fn supported_features(&self) -> Features {
|
||||||
Features {
|
Features {
|
||||||
stop: false,
|
stop: true,
|
||||||
rate: false,
|
rate: false,
|
||||||
pitch: false,
|
pitch: false,
|
||||||
volume: false,
|
volume: false,
|
||||||
|
@ -32,7 +33,8 @@ impl Backend for Tolk {
|
||||||
|
|
||||||
fn stop(&self) -> Result<(), Error> {
|
fn stop(&self) -> Result<(), Error> {
|
||||||
trace!("stop()");
|
trace!("stop()");
|
||||||
unimplemented!();
|
self.0.silence();
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_rate(&self) -> Result<u8, Error> {
|
fn get_rate(&self) -> Result<u8, Error> {
|
||||||
|
|
Loading…
Reference in New Issue