1
0
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:
Nolan Darilek 2021-01-21 10:49:11 -06:00
parent 3e1f5af61a
commit 296fa89f5d
5 changed files with 10 additions and 13 deletions

View File

@ -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"

View File

@ -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

View File

@ -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)]

View File

@ -1,4 +1,4 @@
#[cfg(all(windows, feature = "use_tolk"))]
#[cfg(all(windows, feature = "tolk"))]
use log::{info, trace};
use tolk::Tolk as TolkPtr;

View File

@ -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);