mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-25 11:19:37 +00:00
FFI: Allow determining TTS supported Features from C/C++
This commit is contained in:
parent
7c5ceb2bd3
commit
195ccbeb23
|
@ -5,7 +5,7 @@ use std::{
|
||||||
ptr,
|
ptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{Backends, TTS};
|
use crate::{Backends, Features, TTS};
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
/// Stores the last reported error, so it can be retrieved at will from C
|
/// Stores the last reported error, so it can be retrieved at will from C
|
||||||
|
@ -77,3 +77,10 @@ pub extern "C" fn tts_free(tts: *mut TTS) {
|
||||||
Box::from_raw(tts); // Goes out of scope and is dropped
|
Box::from_raw(tts); // Goes out of scope and is dropped
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the features supported by this TTS engine.
|
||||||
|
/// tts must be a valid pointer to a TTS object.
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn tts_supported_features(tts: *mut TTS) -> Features {
|
||||||
|
unsafe { tts.as_ref().unwrap().supported_features() }
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user