mirror of
https://github.com/mii443/maudio-router.git
synced 2025-08-23 00:15:37 +00:00
add config parser
This commit is contained in:
33
src/commands/run.rs
Normal file
33
src/commands/run.rs
Normal file
@ -0,0 +1,33 @@
|
||||
use crate::args::Run;
|
||||
|
||||
fn reshape_audio_data<T>(input: &[T], channels: usize) -> Vec<Vec<T>>
|
||||
where
|
||||
T: Clone,
|
||||
{
|
||||
let mut output = vec![vec![]; channels];
|
||||
for frame in input.chunks(channels) {
|
||||
for (i, sample) in frame.iter().enumerate() {
|
||||
output[i].push(sample.clone());
|
||||
}
|
||||
}
|
||||
output
|
||||
}
|
||||
|
||||
fn to_flat_audio_data<T>(input: &[Vec<T>]) -> Vec<T>
|
||||
where
|
||||
T: Clone,
|
||||
{
|
||||
let channels = input.len();
|
||||
let frames = input[0].len();
|
||||
let mut output = vec![];
|
||||
for i in 0..frames {
|
||||
for j in 0..channels {
|
||||
output.push(input[j][i].clone());
|
||||
}
|
||||
}
|
||||
output
|
||||
}
|
||||
|
||||
pub fn run(args: Run) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user