SDK crate

psx-sfx

Sample banks and one-shot playback

On this page

Use psx-sfx for game sound effects when direct voice-register management would duplicate bookkeeping. It sits above psx-spu and reads cooked audio through psx-asset.

How the crate is organized

The single source module defines Bank for sample placement, Sample for resident sample metadata, OneShot and LoopingSample for playback configuration, and Player<N> for a fixed set of voices.

Integration notes

Initialize the SPU before uploading a bank. Reserve its sample-memory region and voices against other audio systems. Call Player::tick regularly using the same clock frequency supplied to Player::new; it silences one-shots after their expected duration. One-shot samples include a silent parking tail, while looped ambience uses its loop-aware playback path. Inspect the API's behavior for invalid cooked data and exhausted sample memory before accepting external assets.

The complete audio example covers the underlying SPU path and doesn't use psx-sfx. The reference below has the bank/player usage sequence and method contracts.

API, dependencies and source structure

SDK revision f2fec1c301f1. Structure, dependencies and features below come from this revision.

The PS1 reference includes all Cargo features. The manifest below shows which features are enabled by default.

Dependencies

Cargo features

This crate declares no Cargo features.

Read the complete manifest and feature comments.

Source layout

The list includes internal implementation and test files. Public modules, types, functions and their signatures are indexed in the API reference above.

2 source and manifest files