audioif

audioif — CircuitPython-compatible audio for MicroPython and CPython.

audioif An audio synthesis stack with CircuitPython import names and play/stop/pause/resume semantics. MicroPython firmware includes audiomp3; pydevices-audioif 0.0.1 provides audiocore, synthio, the mixer, and effects for CPython, Android, and Pyodide.

Live Pure-Python Device

Audio usermod architecture

CircuitPython import names, compiled as USER_C_MODULES for MicroPython.

audiocore

Pull-protocol samples: RawSample, WaveFile, get_buffer / reset_buffer. Playback is play() / stop() / pause() / resume().

synthio

Polyphonic synthesizer and MidiTrack. Same object graph CircuitPython tutorials already use.

audiomixer

Mix multiple audiosamples into one output stream with per-voice gain.

Effects & audiomp3

audiofilters, audiodelays, audiofreeverb, audiospeed, plus Helix-backed audiomp3.

Playback on MicroPython

usermods produce samples; pydevices audiodev pumps them into the board transport.

audioif implements CircuitPython’s sample pull protocol. On MicroPython, board_config.audio_out returns audiodev.sample_out.AudioOut, which pulls PCM and writes it to I2S, SDL, WASAPI, or the wasm queue — the same transports already used for raw PCM.

from board_config import audio_out
import synthio

synth = synthio.Synthesizer(sample_rate=22050)
audio_out.play(synth)

Port & host support

Host Build DSP parity Heard on hardware
unix vs CircuitPython oracle (host audio)
windows (host audio)
wasm (browser queue)
ESP32-P4
RP2040 (build-only)