Bump version and Tolk dependency.

pull/11/head v0.17.2
Nolan Darilek 2 years ago
parent d85d56c3ee
commit ca7789f157
  1. 4
      Cargo.toml
  2. 6
      src/backends/tolk.rs
  3. 5
      src/lib.rs

@ -1,6 +1,6 @@
[package]
name = "tts"
version = "0.17.1"
version = "0.17.2"
authors = ["Nolan Darilek <nolan@thewordnerd.info>"]
repository = "https://github.com/ndarilek/tts-rs"
description = "High-level Text-To-Speech (TTS) interface"
@ -21,7 +21,7 @@ thiserror = "1"
env_logger = "0.8"
[target.'cfg(windows)'.dependencies]
tolk = { version = "0.4", optional = true }
tolk = { version = "0.5", optional = true }
windows = "0.9"
[target.'cfg(windows)'.build-dependencies]

@ -1,17 +1,19 @@
#[cfg(all(windows, feature = "tolk"))]
use std::sync::Arc;
use log::{info, trace};
use tolk::Tolk as TolkPtr;
use crate::{Backend, BackendId, Error, Features, UtteranceId};
#[derive(Clone, Debug)]
pub(crate) struct Tolk(TolkPtr);
pub(crate) struct Tolk(Arc<TolkPtr>);
impl Tolk {
pub(crate) fn new() -> Option<Self> {
info!("Initializing Tolk backend");
let tolk = TolkPtr::new();
if tolk::Tolk::detect_screen_reader().is_some() {
if tolk.detect_screen_reader().is_some() {
Some(Tolk(tolk))
} else {
None

@ -27,6 +27,8 @@ use libc::c_char;
#[cfg(target_os = "macos")]
use objc::{class, msg_send, sel, sel_impl};
use thiserror::Error;
#[cfg(all(windows, feature = "tolk"))]
use tolk::Tolk;
mod backends;
@ -537,7 +539,8 @@ impl Tts {
{
#[cfg(feature = "tolk")]
{
return tolk::Tolk::detect_screen_reader().is_some();
let tolk = Tolk::new();
return tolk.detect_screen_reader().is_some();
}
#[cfg(not(feature = "tolk"))]
return false;

Loading…
Cancel
Save