4 releases
0.2.1 | Oct 5, 2023 |
---|---|
0.2.0 | Oct 2, 2023 |
0.1.1 | Apr 10, 2023 |
0.1.0 | Apr 7, 2023 |
#2438 in Parser implementations
253 downloads per month
25KB
461 lines
HPS Decode
A Rust library for parsing and decoding Super Smash Bros. Melee music files.
Quick Start
Here is a quick example of how to play a stereo .hps
file with the
rodio-source
feature flag and rodio 0.17:
use hps_decode::Hps;
use rodio::{OutputStream, Sink};
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
// Decode an .hps file into PCM samples for playback
let hps: Hps = std::fs::read("./respect-your-elders.hps")?.try_into()?;
let audio = hps.decode()?;
// Play the song with the rodio library
let (_stream, stream_handle) = OutputStream::try_default()?;
let sink = Sink::try_new(&stream_handle)?;
sink.append(audio);
sink.play();
sink.sleep_until_end();
Ok(())
}
Documentation
Check out docs.rs for more details about the library.
.HPS File Layout
For general purpose, language agnostic information about the .hps
file format,
see here.
Dependencies
~2–34MB
~474K SLoC