Make wave reading a bit clearer.

This commit is contained in:
Nolan Darilek 2022-02-01 14:22:41 -06:00
parent 3dada2fd8d
commit e053cfaa72

View File

@ -101,8 +101,10 @@ impl AssetLoader for BufferAssetLoader {
let reader = hound::WavReader::new(cursor); let reader = hound::WavReader::new(cursor);
if let Ok(mut reader) = reader { if let Ok(mut reader) = reader {
let mut samples: Vec<i16> = vec![]; let mut samples: Vec<i16> = vec![];
for sample in reader.samples::<i16>().flatten() { for sample in reader.samples::<i16>() {
samples.push(sample); if let Ok(sample) = sample {
samples.push(sample);
}
} }
Some(Buffer { Some(Buffer {
samples, samples,