mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-11-23 09:45:56 +00:00
Make wave reading a bit clearer.
This commit is contained in:
parent
3dada2fd8d
commit
e053cfaa72
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user