mirror of
https://github.com/lightsoutgames/godot-tts
synced 2024-10-03 10:05:57 +00:00
Add support for separating Tolk dependency for use on UWP.
This commit is contained in:
parent
f7a2ac7760
commit
e19d154b99
|
@ -7,10 +7,14 @@ edition = "2018"
|
|||
[lib]
|
||||
crate-type = ["staticlib", "cdylib"]
|
||||
|
||||
[features]
|
||||
|
||||
use_tolk = ["tolk", "tts/use_tolk"]
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.7"
|
||||
gdnative = "0.9"
|
||||
tts = "0.9"
|
||||
tts = "0.10"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
tolk = ">= 0.2.1"
|
||||
tolk = { version = ">= 0.2.1", optional = true }
|
||||
|
|
|
@ -7,7 +7,7 @@ This addon was primarily developed for the [Godot Accessibility addon](https://g
|
|||
Text-to-speech is complicated, and some features may not work everywhere. Most optional features have an associated boolean property used to determine if the feature is available. Further, while I do attempt to ensure that this addon works as well as possible on all platforms, there may be bugs, and pull requests are welcome. Known supported platforms include:
|
||||
|
||||
* Windows
|
||||
* Screen readers/SAPI via Tolk
|
||||
* Screen readers/SAPI via Tolk (requires `use_tolk` Cargo feature)
|
||||
* WinRT
|
||||
* Linux via [Speech Dispatcher](https://freebsoft.org/speechd)
|
||||
* MacOS
|
||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -121,13 +121,19 @@ impl TTS {
|
|||
.done();
|
||||
builder
|
||||
.add_property("can_detect_screen_reader")
|
||||
.with_getter(|_: &TTS, _| if cfg!(windows) { true } else { false })
|
||||
.with_getter(|_: &TTS, _| {
|
||||
if cfg!(all(windows, features = "use_tolk")) {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
})
|
||||
.done();
|
||||
#[allow(unreachable_code)]
|
||||
builder
|
||||
.add_property("has_screen_reader")
|
||||
.with_getter(|_: &TTS, _| {
|
||||
#[cfg(windows)]
|
||||
#[cfg(all(windows, features = "use_tolk"))]
|
||||
{
|
||||
let tolk = tolk::Tolk::new();
|
||||
return tolk.detect_screen_reader().is_some();
|
||||
|
|
Loading…
Reference in New Issue
Block a user