SDK crate

psx-spu

Sound voices, sample RAM and envelopes

On this page

Use psx-spu to configure the sound hardware directly. It supplies typed voice indices, pitch, volume, ADSR envelopes and aligned sample addresses.

How the crate is organized

Spu::new takes the SPU's DMA token and owns sample upload (Spu::upload_adpcm). The root also contains initialization, voice configuration, key-on/key-off, loop, noise and interrupt helpers. Voice, Pitch, Volume, CdVolume, Adsr and SpuAddr keep the different register representations distinct.

Integration notes

Create the Spu from its token, upload prepared ADPCM, configure a voice and start it. Pitch uses a fixed-point sample-rate multiplier; addresses passed to SpuAddr are byte offsets with the required alignment. Keep sample memory and voices from overlapping other audio users. A one-shot's end flag is not a general voice-lifetime manager: use psx-sfx when you want timed cutoff and shared voice allocation. SPU IRQ helpers do not take ownership of CPU interrupt acknowledgement or your refill schedule.

See the sound how-to and full hello-audio source.

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

  • psx-hw (shared repository crate): all targets
  • psx-io: all targets

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