simvx.core.audio¶
Audio system: background music, UI sounds, and 3D spatial audio.
This module provides:
AudioClip: Audio resource (WAV/OGG data)
AudioPlayer: Background music/UI sounds
AudioPlayer2D: 2D positional audio with panning
AudioPlayer3D: 3D spatial audio with attenuation
Public API::
from simvx.core import AudioClip, AudioPlayer, Resource
# Filesystem audio file
player = AudioPlayer(stream="music/theme.ogg", autoplay=True)
# Asset shipped inside a Python package
sfx = AudioPlayer2D(stream=Resource("game.assets", "explosion.wav"))
sfx.play()
# Synthetic procedural tone
beep = AudioPlayer(stream=AudioClip.tone(440))
beep.play()
This module is a thin facade. The implementation lives in private leaf
modules: _audio_stream (the :class:AudioClip resource + container
detection / WAV seek helpers), _audio_playback (the shared
- class:
_AudioPlaybackMixin), and_audio_players(the three player nodes). Import the public names from here or from :mod:simvx.core.
Module Contents¶
Data¶
API¶
- simvx.core.audio.__all__¶
[‘AudioClip’, ‘AudioPlayer’, ‘AudioPlayer2D’, ‘AudioPlayer3D’]