Skip to content

Audio Player (Radio)

App: apps/audio_player/

A radio-style player: tune with Left/Right arrow keys. When you’re on a station’s frequency, that channel plays; as you tune away, static increases. Stations are defined in channels.toml.

Terminal window
% ./plume3d audio_player

or

Terminal window
% ./../plume3d .
  • Left / Right — Tune the FM frequency (88–108 MHz). On a station’s frequency that channel plays; off-frequency you hear static.
  1. Channels — Edit channels.toml. Each entry has:

    • name — Display name
    • path — Path under the app (e.g. sounds/mytrack.wav)
    • frequency — “Perfect” FM value (88.0–108.0) for tuning
  2. Music — Put WAV (or supported) files in sounds/ and set path in channels.toml.

  3. Static — Generate sounds/static.wav with:

    Terminal window
    python3 sounds/gen_static.py

    Without it, the app runs but there’s no static effect.

  • ConfigConfig.load("channels.toml") returns the TOML as a Map; the app reads config["channels"] (list of name, path, frequency).
  • AudionewSource, play, stop, isPlaying.
  • SourcesetVolume, setLooping.
  • Window, Gui, Input, Math.

Stations are fully data-driven: add or remove entries in channels.toml; no code changes needed.