Skip to content

sound_file

FreeBodyEngine.audio.sound_file #

SoundFileAudioManager() #

Bases: AudioManager

Native audio implementation using sounddevice.

channels = 2 instance-attribute #

lock = threading.Lock() instance-attribute #

sample_rate = 48000 instance-attribute #

stream = sd.OutputStream(samplerate=(self.sample_rate), channels=(self.channels), dtype='float32', callback=(self.callback), finished_callback=(self.on_stream_finished), blocksize=1024, latency='low') instance-attribute #

add_sound(sound) #

callback(outdata, frames, time_info, status) #

Mixes all active sounds into the native output stream.

create_sound(data) #

on_stream_finished() #

remove_sound(sound) #

shutdown() #

resample_audio(data, orig_sr, target_sr) #