simvx.core.audio_backend._null¶
The silent (no-op) audio backend.
NullAudioBackend is selected when no audio device is available (sandboxed
CI, headless containers). Calls return valid channel IDs and behave
consistently, but nothing is rendered to a device.
Module Contents¶
Classes¶
Silent backend implementing :class: |
API¶
- class simvx.core.audio_backend._null.NullAudioBackend(sample_rate: int = _DEFAULT_SAMPLE_RATE, nchannels: int = _DEFAULT_CHANNELS)[source]¶
Silent backend implementing :class:
AudioPlaybackBackend+ :class:AudioBusBackend.Selected automatically by :func:
make_backendwhen neither the native extension nor the legacyminiaudiopath can start (e.g. no audio device on the host, ALSA/Pulse not running, theminiaudioPython package not installed, or a sandboxed environment with no compiler).The engine, scene tree, and :class:
AudioPlayernodes all operate normally: calls return valid channel IDs and- Meth:
is_channel_activebehaves consistently, but nothing is rendered to a device.
NullBackend does NOT implement :class:
AudioStreamingBackend. Code paths that need streaming (procedural synth via- Class:
AudioSynth.attach_to, AudioWorklet feeds, etc.) must checkisinstance(backend, AudioStreamingBackend)and raise / warn-once when it’s absent. Advertised capabilities are narrowed to{Capability.PLAY_BASIC}so effect modules don’t try to instantiate native nodes on the null path.
Initialization
- play_audio(stream: simvx.core.audio.AudioClip, *, mode: str = 'non_positional', position: Any = None, volume_db: float = 0.0, pitch: float = 1.0, loop: bool = False, bus: str = 'Master', max_distance: float = 100.0, from_position: float = 0.0, pan: float = 0.0, gain_db: float = 0.0) int | None[source]¶
- list_capabilities() frozenset[simvx.core.audio_protocol.Capability][source]¶
- sync_bus_layout(layout: simvx.core.audio_bus.AudioBusLayout) None[source]¶