mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: fixing refactor errors pt.2
This commit is contained in:
parent
a6d6f5f06d
commit
7909caf6a8
4 changed files with 38 additions and 23 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue