wip: fixing refactor errors pt.2

This commit is contained in:
🪞👃🪞 2024-11-09 23:33:18 +01:00
parent a6d6f5f06d
commit 7909caf6a8
4 changed files with 38 additions and 23 deletions

View file

@ -143,22 +143,6 @@ impl Sample {
}};
}
/// Read WAV from file
pub fn read_sample_data (src: &str) -> Usually<(usize, Vec<Vec<f32>>)> {
let mut channels: Vec<wavers::Samples<f32>> = vec![];
for channel in wavers::Wav::from_path(src)?.channels() {
channels.push(channel);
}
let mut end = 0;
let mut data: Vec<Vec<f32>> = vec![];
for samples in channels.iter() {
let channel = Vec::from(samples.as_ref());
end = end.max(channel.len());
data.push(channel);
}
Ok((end, data))
}
use std::fs::File;
use symphonia::core::codecs::CODEC_TYPE_NULL;
use symphonia::core::errors::Error;