A cycle-accurate Apple II and Apple IIgs emulator written in Zig, usable as both a program and a library.

live audio: the machine's sound out of a real speaker

Until now the speaker and the Ensoniq only ever went into a .wav. They play live now, on by default, out of the host's own audio: on Linux through PipeWire, the user's zig-pipewire client, which is pure Zig over the daemon's socket and so links no library and wants only a daemon running to make a sound. A machine with no daemon to talk to falls back to silence rather than failing. The seam is `tools/audio.zig`, a shared front-end module beside terminal.zig and config.zig: an `Output` with a volume over it, and a `Backend` chosen for the target at compile time -- Linux is PipeWire, everywhere else is silent until somebody writes one, which is where another platform's audio goes. The front ends own the Output so it survives a machine reset; the library stays about machines and knows nothing of the host's audio. The two rendering paths feed it without being read twice. The eight-bit `Recording` renders the speaker and Mockingboard once and fans the samples out to the file, the live speaker, or both. The IIgs Ensoniq recorder, which lives in the library and must not import the front end, keeps its samples in a plain f32 buffer that gs.zig drains between machine steps. Both take the live graph's rate so the renderers and the file agree with it. .wav in and out is untouched: --audio still records, --cassette-in still reads a tape, --cassette-out still writes one. A file holds the machine to real time as before; live audio does not, dropping what it cannot keep up with, so the speed keys still work when only the speaker is playing. Configurable from the config file (`sound`, `volume`, `mute`) and the command line (--no-audio, --volume N, --mute), and worked from the keyboard behind the alt modifier like every other front-end command: alt+, quieter, alt+. louder, alt+/ mute. The stream shows up in the host's mixer as `zig65`, to be moved or levelled from the usual tools. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01969H4dxMhArn3Co6Dr6k6w


Author jcollie.dev
Co-author Claude Opus 4.8 Date Commit Parent b08368e3