Exception raised for OpenAL related errors.
No methods defined.
Audio events for OpenAL system.
COMPLETE: Any = 'complete'
STOP: Any = 'stop'
PAUSE: Any = 'pause'
RESUME: Any = 'resume'
No methods defined.
OpenAL audio buffer with memory pooling.
Manages audio data in OpenAL buffers with caching for frequently used sounds.
Attributes:
buffer_id (int): OpenAL buffer ID
duration (float): Buffer duration in seconds
size (int): Buffer size in bytes
format (int): OpenAL format constant
frequency (int): Sample rate in Hz
last_used (float): Last access time for LRU cleanup
_buffer_pool: Dict[str, 'OpenALBuffer'] = {}
def __init__(self: Any, buffer_id: int) -> Any
def get_or_create(cls: Any, filepath: str) -> Optional['OpenALBuffer']
def _update_buffer_info(self: Any) -> Any
def _load_audio_file(buffer_id: ALuint, filepath: str) -> bool
def _load_wav_file(buffer_id: ALuint, filepath: str) -> bool
def _load_with_pygame(buffer_id: ALuint, filepath: str) -> bool
def cleanup_unused(cls: Any, max_age: float = 300.0) -> Any
def get_duration(self: Any) -> float
OpenAL audio source for 2D games.
Provides playback control with smooth transitions and stereo panning.
Attributes:
source_id (int): OpenAL source ID
buffer (OpenALBuffer): Current audio buffer
volume (float): Current volume (0.0-1.0)
pitch (float): Current pitch multiplier
pan (float): Stereo pan (-1.0 to 1.0)
looping (bool): Whether source is looping
def __init__(self: Any, source_id: int) -> Any
def set_buffer(self: Any, buffer: OpenALBuffer) -> Any
def set_volume(self: Any, volume: float, duration: float = 0.0) -> Any
def _fade_volume(self: Any, start: float, end: float, duration: float) -> Any
def set_pitch(self: Any, pitch: float, duration: float = 0.0) -> Any
def set_pan(self: Any, pan: float) -> Any
def play(self: Any, loop: bool = False) -> Any
def pause(self: Any) -> Any
def resume(self: Any) -> Any
def stop(self: Any) -> Any
def rewind(self: Any) -> Any
def is_playing(self: Any) -> bool
def is_paused(self: Any) -> bool
def get_playback_position(self: Any) -> float
Main OpenAL audio system for 2D games.
Manages audio sources, buffers, and provides playback functionality.
Attributes:
device: OpenAL device
context: OpenAL context
sources (List[OpenALSource]): Available audio sources
max_sources (int): Maximum number of concurrent sources
initialized (bool): Whether system is initialized
def __init__(self: Any, max_sources: int = 32) -> Any
def initialize(self: Any) -> bool
def get_free_source(self: Any) -> Optional[OpenALSource]
def load_sound(self: Any, filepath: str) -> Optional[OpenALBuffer]
def play_sound(self: Any, filepath: str, volume: float = 1.0, pitch: float = 1.0, pan: float = 0.0, loop: bool = False) -> Optional[OpenALSource]
def stop_all(self: Any) -> Any
def update(self: Any) -> Any
def cleanup(self: Any) -> Any
Audio visualizer that works with OpenAL audio system.
Provides methods to capture and analyze audio data from OpenAL sources.
def __init__(self: Any, audio_system: OpenALAudioSystem) -> Any
def _initialize_buffers(self: Any) -> Any
def capture_audio_data(self: Any, source: Optional[OpenALSource] = None) -> List[float]
def perform_fft_analysis(self: Any, audio_data: List[float]) -> List[float]
def get_peak_level(self: Any) -> float
def get_rms_level(self: Any) -> float
def _get_simulated_data(self: Any) -> List[float]
def get_audio_system() -> OpenALAudioSystem
Get global audio system instance.
def initialize_audio(max_sources: int = 32) -> bool
Initialize global audio system.
def cleanup_audio() -> Any
Clean up global audio system.