mirror of https://github.com/ndarilek/tts-rs.git
cargo fmt
This commit is contained in:
parent
6057d9c968
commit
c222c087b2
|
@ -9,8 +9,8 @@ use log::{info, trace};
|
||||||
use objc::runtime::{Object, Sel};
|
use objc::runtime::{Object, Sel};
|
||||||
use objc::{class, declare::ClassDecl, msg_send, sel, sel_impl};
|
use objc::{class, declare::ClassDecl, msg_send, sel, sel_impl};
|
||||||
|
|
||||||
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};
|
|
||||||
use crate::voices::Backend as VoiceBackend;
|
use crate::voices::Backend as VoiceBackend;
|
||||||
|
use crate::{Backend, BackendId, Error, Features, UtteranceId, CALLBACKS};
|
||||||
|
|
||||||
mod voices;
|
mod voices;
|
||||||
use voices::*;
|
use voices::*;
|
||||||
|
@ -285,7 +285,10 @@ impl Backend for AvFoundation {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn list_voices(&self) -> Vec<String> {
|
fn list_voices(&self) -> Vec<String> {
|
||||||
AVSpeechSynthesisVoice::list().iter().map(|v| {v.id()}).collect()
|
AVSpeechSynthesisVoice::list()
|
||||||
|
.iter()
|
||||||
|
.map(|v| v.id())
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_voice(&mut self, voice: &str) -> Result<(), Error> {
|
fn set_voice(&mut self, voice: &str) -> Result<(), Error> {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
|
use cocoa_foundation::base::{id, nil};
|
||||||
|
use cocoa_foundation::foundation::NSString;
|
||||||
|
use core_foundation::array::CFArray;
|
||||||
|
use core_foundation::string::CFString;
|
||||||
use objc::runtime::*;
|
use objc::runtime::*;
|
||||||
use objc::*;
|
use objc::*;
|
||||||
use core_foundation::array::CFArray;
|
|
||||||
use cocoa_foundation::foundation::NSString;
|
|
||||||
use cocoa_foundation::base::{nil,id};
|
|
||||||
use core_foundation::string::CFString;
|
|
||||||
|
|
||||||
use crate::backends::AvFoundation;
|
use crate::backends::AvFoundation;
|
||||||
use crate::voices;
|
use crate::voices;
|
||||||
|
@ -36,9 +35,12 @@ impl voices::Backend for AVSpeechSynthesisVoice {
|
||||||
|
|
||||||
fn list() -> Vec<Self> {
|
fn list() -> Vec<Self> {
|
||||||
let voices: CFArray = unsafe { msg_send![class!(AVSpeechSynthesisVoice), speechVoices] };
|
let voices: CFArray = unsafe { msg_send![class!(AVSpeechSynthesisVoice), speechVoices] };
|
||||||
voices.iter().map(|v| {
|
voices
|
||||||
AVSpeechSynthesisVoice{0: *v as *const Object}
|
.iter()
|
||||||
}).collect()
|
.map(|v| AVSpeechSynthesisVoice {
|
||||||
|
0: *v as *const Object,
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name(self) -> String {
|
fn name(self) -> String {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
pub use unic_langid::LanguageIdentifier;
|
pub use unic_langid::LanguageIdentifier;
|
||||||
|
|
||||||
pub enum Gender {
|
pub enum Gender {
|
||||||
|
|
Loading…
Reference in New Issue