Expand description
Contains DecodedHps for iterating over decoded PCM samples. For looping
songs, this is an infinite iterator. While an iterator like this is useful
for audio playback, you may need to access the samples directly for other
kinds of applications.
§Getting a vec of PCM samples
If you’d like to get a vec of the underlying PCM samples, use
.samples() to get the PCM samples as a slice, then
collect them into a vec:
let hps: Hps = std::fs::read("./respect-your-elders.hps")?.try_into()?;
let audio: DecodedHps = hps.decode()?;
let samples: Vec<i16> = audio.samples().to_vec();
assert_eq!(samples.len(), 6_415_472);Structs§
- Decoded
Hps - An iterator over decoded PCM samples.