mirror of https://github.com/ndarilek/tts-rs.git
cargo fmt
This commit is contained in:
parent
103a0c043d
commit
e82a10ba16
|
@ -1,5 +1,4 @@
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
|
||||||
use std::u8;
|
use std::u8;
|
||||||
|
|
||||||
use log::{info, trace};
|
use log::{info, trace};
|
||||||
|
@ -18,7 +17,7 @@ impl SpeechDispatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn u8_to_i32(v: u8) -> i32 {
|
fn u8_to_i32(v: u8) -> i32 {
|
||||||
let ratio: f32 = v as f32/u8::MAX as f32;
|
let ratio: f32 = v as f32 / u8::MAX as f32;
|
||||||
(ratio * 200. - 100.) as i32
|
(ratio * 200. - 100.) as i32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
|
||||||
use std::u8;
|
use std::u8;
|
||||||
|
|
||||||
use log::{info, trace};
|
use log::{info, trace};
|
||||||
|
|
|
@ -51,7 +51,6 @@ trait Backend {
|
||||||
pub struct TTS(Box<Backend>);
|
pub struct TTS(Box<Backend>);
|
||||||
|
|
||||||
impl TTS {
|
impl TTS {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new `TTS` instance with the specified backend.
|
* Create a new `TTS` instance with the specified backend.
|
||||||
*/
|
*/
|
||||||
|
@ -63,7 +62,7 @@ impl TTS {
|
||||||
Backends::Web => {
|
Backends::Web => {
|
||||||
let tts = backends::Web::new()?;
|
let tts = backends::Web::new()?;
|
||||||
Ok(TTS(Box::new(tts)))
|
Ok(TTS(Box::new(tts)))
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue