mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-21 09:19:37 +00:00
Upgrade windows-rs to 0.23.
This commit is contained in:
parent
dc3129b79c
commit
92538fbdb8
14
Cargo.toml
14
Cargo.toml
|
@ -20,12 +20,18 @@ thiserror = "1"
|
|||
[dev-dependencies]
|
||||
env_logger = "0.8"
|
||||
|
||||
[dependencies.windows]
|
||||
version = "0.23"
|
||||
features = [
|
||||
"Foundation",
|
||||
"Media_Core",
|
||||
"Media_Playback",
|
||||
"Media_SpeechSynthesis",
|
||||
"Storage_Streams",
|
||||
]
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
tolk = { version = "0.5", optional = true }
|
||||
windows = "0.9"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
windows = "0.9"
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
speech-dispatcher = "0.7"
|
||||
|
|
10
build.rs
10
build.rs
|
@ -1,14 +1,4 @@
|
|||
fn main() {
|
||||
#[cfg(windows)]
|
||||
if std::env::var("TARGET").unwrap().contains("windows") {
|
||||
windows::build!(
|
||||
Windows::Foundation::{EventRegistrationToken, IAsyncOperation, TypedEventHandler},
|
||||
Windows::Media::Core::MediaSource,
|
||||
Windows::Media::Playback::{MediaPlaybackSession, MediaPlaybackState, MediaPlayer, MediaPlayerAudioCategory},
|
||||
Windows::Media::SpeechSynthesis::{SpeechSynthesisStream, SpeechSynthesizer, SpeechSynthesizerOptions},
|
||||
Windows::Storage::Streams::IRandomAccessStream,
|
||||
);
|
||||
}
|
||||
if std::env::var("TARGET").unwrap().contains("-apple") {
|
||||
println!("cargo:rustc-link-lib=framework=AVFoundation");
|
||||
if !std::env::var("CARGO_CFG_TARGET_OS")
|
||||
|
|
|
@ -4,10 +4,7 @@ use std::sync::Mutex;
|
|||
|
||||
use lazy_static::lazy_static;
|
||||
use log::{info, trace};
|
||||
|
||||
mod bindings;
|
||||
|
||||
use bindings::Windows::{
|
||||
use windows::{
|
||||
Foundation::TypedEventHandler,
|
||||
Media::{
|
||||
Core::MediaSource,
|
||||
|
@ -18,8 +15,8 @@ use bindings::Windows::{
|
|||
|
||||
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};
|
||||
|
||||
impl From<windows::Error> for Error {
|
||||
fn from(e: windows::Error) -> Self {
|
||||
impl From<windows::runtime::Error> for Error {
|
||||
fn from(e: windows::runtime::Error) -> Self {
|
||||
Error::WinRt(e)
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
::windows::include_bindings!();
|
|
@ -117,7 +117,7 @@ pub enum Error {
|
|||
JavaScriptError(wasm_bindgen::JsValue),
|
||||
#[cfg(windows)]
|
||||
#[error("WinRT error")]
|
||||
WinRt(windows::Error),
|
||||
WinRt(windows::runtime::Error),
|
||||
#[error("Unsupported feature")]
|
||||
UnsupportedFeature,
|
||||
#[error("Out of range")]
|
||||
|
|
Loading…
Reference in New Issue
Block a user