mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-17 10:19:38 +00:00
Bump version, and use automatically-provided feature provided by optional tolk dependency.
This commit is contained in:
parent
3e1f5af61a
commit
296fa89f5d
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "tts"
|
||||
version = "0.13.1"
|
||||
version = "0.14.0"
|
||||
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
|
||||
repository = "https://github.com/ndarilek/tts-rs"
|
||||
description = "High-level Text-To-Speech (TTS) interface"
|
||||
|
@ -11,9 +11,6 @@ edition = "2018"
|
|||
[lib]
|
||||
crate-type = ["lib", "cdylib", "staticlib"]
|
||||
|
||||
[features]
|
||||
use_tolk = ["tolk"]
|
||||
|
||||
[dependencies]
|
||||
dyn-clonable = "0.9"
|
||||
lazy_static = "1"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
This library provides a high-level Text-To-Speech (TTS) interface supporting various backends. Currently supported backends are:
|
||||
|
||||
* Windows
|
||||
* Screen readers/SAPI via Tolk (requires `use_tolk` Cargo feature)
|
||||
* Screen readers/SAPI via Tolk (requires `tolk` Cargo feature)
|
||||
* WinRT
|
||||
* Linux via [Speech Dispatcher](https://freebsoft.org/speechd)
|
||||
* MacOS/iOS
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#[cfg(target_os = "linux")]
|
||||
mod speech_dispatcher;
|
||||
|
||||
#[cfg(all(windows, feature = "use_tolk"))]
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
mod tolk;
|
||||
|
||||
#[cfg(windows)]
|
||||
|
@ -22,7 +22,7 @@ mod android;
|
|||
#[cfg(target_os = "linux")]
|
||||
pub(crate) use self::speech_dispatcher::*;
|
||||
|
||||
#[cfg(all(windows, feature = "use_tolk"))]
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
pub(crate) use self::tolk::*;
|
||||
|
||||
#[cfg(windows)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[cfg(all(windows, feature = "use_tolk"))]
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
use log::{info, trace};
|
||||
use tolk::Tolk as TolkPtr;
|
||||
|
||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -2,7 +2,7 @@
|
|||
* a Text-To-Speech (TTS) library providing high-level interfaces to a variety of backends.
|
||||
* Currently supported backends are:
|
||||
* * Windows
|
||||
* * Screen readers/SAPI via Tolk (requires `use_tolk` Cargo feature)
|
||||
* * Screen readers/SAPI via Tolk (requires `tolk` Cargo feature)
|
||||
* * WinRT
|
||||
* * Linux via [Speech Dispatcher](https://freebsoft.org/speechd)
|
||||
* * MacOS/iOS
|
||||
|
@ -36,7 +36,7 @@ pub enum Backends {
|
|||
SpeechDispatcher,
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
Web,
|
||||
#[cfg(all(windows, feature = "use_tolk"))]
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
Tolk,
|
||||
#[cfg(windows)]
|
||||
WinRT,
|
||||
|
@ -187,7 +187,7 @@ impl TTS {
|
|||
let tts = backends::Web::new()?;
|
||||
Ok(TTS(Box::new(tts)))
|
||||
}
|
||||
#[cfg(all(windows, feature = "use_tolk"))]
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
Backends::Tolk => {
|
||||
let tts = backends::Tolk::new();
|
||||
if let Some(tts) = tts {
|
||||
|
@ -225,13 +225,13 @@ impl TTS {
|
|||
pub fn default() -> Result<TTS, Error> {
|
||||
#[cfg(target_os = "linux")]
|
||||
let tts = TTS::new(Backends::SpeechDispatcher);
|
||||
#[cfg(all(windows, feature = "use_tolk"))]
|
||||
#[cfg(all(windows, feature = "tolk"))]
|
||||
let tts = if let Ok(tts) = TTS::new(Backends::Tolk) {
|
||||
Ok(tts)
|
||||
} else {
|
||||
TTS::new(Backends::WinRT)
|
||||
};
|
||||
#[cfg(all(windows, not(feature = "use_tolk")))]
|
||||
#[cfg(all(windows, not(feature = "tolk")))]
|
||||
let tts = TTS::new(Backends::WinRT);
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let tts = TTS::new(Backends::Web);
|
||||
|
|
Loading…
Reference in New Issue
Block a user