audiodev.auto
Optional host backend selection. Backends never import this module.
- audiodev.auto.select_backend()[source]
Return the name of the first usable output backend.
Search order:
OMNIPYTHON_AUDIOif set, then the backends a board config asked for withrequire(seebackends), then the ones in the box in the documented probe order: wasm, Web Audio, Windows, SDL2, pygame, then ALSA on a Linux machine with a sound card and neither SDL2 nor pygame.
- audiodev.auto.pcm_out(format=None, **kwargs)[source]
Construct a raw
PCMOutputviaselect_backend.Push bytes at it with
write(). This is what a consumer that already has PCM wants – a Connect speaker, a USB audio pump – and it needs no audiodsp, because no sample graph is ever pulled.
- audiodev.auto.pcm_in(format=None, **kwargs)[source]
Construct a raw
PCMInputviaselect_backend.
- audiodev.auto.audio_out(format=None, **kwargs)[source]
Construct an
AudioOutsample player.play(sample)over a CircuitPython-shaped audiosample. This is what a board’saudio_outrole returns, and the name means the same thing here as it does there – seepcm_outfor the raw sink.chunk_ms/lookahead_chunks/max_catchup_chunksgo to theAudioOutpump; everything else goes to the transport factory.latency="low"also shrinks the pump’s chunk to 20ms (a 40ms schedule with the default 2-chunk lookahead) – the transport profile alone cannot lower note-to-sound latency below what the pump keeps rendered ahead.