App icon, logs are now stored to log.txt file, work in progress on intergration with rustpotter

This commit is contained in:
Abraham 2023-04-29 14:58:16 +05:00
parent 4e1413d400
commit 5f35beb5cf
72 changed files with 515 additions and 2993 deletions

View file

@ -1,5 +1,5 @@
use std::sync::Mutex;
use vosk::{CompleteResult, DecodingState, Model, Recognizer};
use vosk::{DecodingState, Model, Recognizer};
use crate::config::VOSK_MODEL_PATH;
@ -46,13 +46,13 @@ pub fn recognize(data: &[i16]) -> Option<String> {
}
}
pub fn stereo_to_mono(input_data: &[i16]) -> Vec<i16> {
let mut result = Vec::with_capacity(input_data.len() / 2);
result.extend(
input_data
.chunks_exact(2)
.map(|chunk| chunk[0] / 2 + chunk[1] / 2),
);
// pub fn stereo_to_mono(input_data: &[i16]) -> Vec<i16> {
// let mut result = Vec::with_capacity(input_data.len() / 2);
// result.extend(
// input_data
// .chunks_exact(2)
// .map(|chunk| chunk[0] / 2 + chunk[1] / 2),
// );
result
}
// result
// }