MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / data_callback

Function data_callback

StereoKitC/systems/audio.cpp:141–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139///////////////////////////////////////////
140
141void data_callback(ma_device*, void* output, const void*, ma_uint32 frame_count) {
142 float* output_f = (float*)output;
143
144 for (uint32_t i = 0; i < _countof(au_active_sounds); i++) {
145 if (au_active_sounds[i].sound == nullptr)
146 continue;
147
148 ma_uint32 framesRead = read_and_mix_pcm_frames_f32(au_active_sounds[i], output_f, frame_count);
149 if (framesRead < frame_count && au_active_sounds[i].sound->type != sound_type_stream) {
150 sound_release(au_active_sounds[i].sound);
151 au_active_sounds[i].sound = nullptr;
152 }
153 }
154}
155
156///////////////////////////////////////////
157

Callers

nothing calls this directly

Calls 2

sound_releaseFunction · 0.85

Tested by

no test coverage detected