mirror of
https://github.com/ndarilek/tts-rs.git
synced 2024-11-17 13:09:37 +00:00
fix return type of AVSpeechSynthesisVoice:new
This commit is contained in:
parent
1b8809aaeb
commit
b238c8c938
|
@ -11,10 +11,12 @@ pub struct AVSpeechSynthesisVoice(*const Object);
|
|||
|
||||
impl AVSpeechSynthesisVoice {
|
||||
pub fn new(identifier: &str) -> Self {
|
||||
let voice: *const Object;
|
||||
unsafe{
|
||||
let i: id = NSString::alloc(nil).init_str(identifier);
|
||||
msg_send![class!(AVSpeechSynthesisVoice), voiceWithIdentifier:i]
|
||||
}
|
||||
voice = msg_send![class!(AVSpeechSynthesisVoice), voiceWithIdentifier:i];
|
||||
};
|
||||
AVSpeechSynthesisVoice{0:voice}
|
||||
}
|
||||
|
||||
pub fn default() -> Self {
|
||||
|
@ -24,7 +26,7 @@ impl AVSpeechSynthesisVoice {
|
|||
pub fn list() -> Vec<Self> {
|
||||
let voices: CFArray = unsafe{msg_send![class!(AVSpeechSynthesisVoice), speechVoices]};
|
||||
voices.iter().map(|v| {
|
||||
AVSpeechSynthesisVoice{0: *v as *mut Object}
|
||||
AVSpeechSynthesisVoice{0: *v as *const Object}
|
||||
}).collect()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user