| Crates.io | hps_decode |
| lib.rs | hps_decode |
| version | 0.3.0 |
| created_at | 2023-04-07 16:37:14.481405+00 |
| updated_at | 2025-09-22 01:20:44.406175+00 |
| description | A library for parsing and decoding Super Smash Bros. Melee music files |
| homepage | |
| repository | https://github.com/DarylPinto/hps_decode |
| max_upload_size | |
| id | 833022 |
| size | 68,268 |
A Rust library for parsing and decoding Super Smash Bros. Melee music files.
Decoding a stereo .hps file into audio and listening to it with
rodio:
Install dependencies:
cargo add rodio --no-default-features --features playback
cargo add hps_decode --features rodio-source
In your main.rs:
use hps_decode::Hps;
use rodio::{OutputStreamBuilder, Sink};
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
// Decode an .hps file into raw audio data
let hps: Hps = std::fs::read("./respect-your-elders.hps")?.try_into()?;
let audio = hps.decode()?;
// Play it using the rodio crate
let stream_handle = OutputStreamBuilder::open_default_stream()?;
let sink = Sink::connect_new(&stream_handle.mixer());
let source = audio.into_rodio_source();
sink.append(source);
sink.play();
sink.sleep_until_end();
Ok(())
}
Check out docs.rs for more details about the library.
This library can be benchmarked using criterion by running cargo bench. Reports with the results will be generated at target/criterion/report/index.html
For general purpose, language agnostic information about the .hps file format,
see here.