MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / audio_render_callback

Function audio_render_callback

native/tvos/src/lib.rs:2613–2627  ·  view source on GitHub ↗
(
    _in_ref_con: *mut c_void,
    _io_action_flags: *mut u32,
    _in_time_stamp: *const c_void,
    _in_bus_number: u32,
    in_number_frames: u32,
    io_data: *mut AudioBufferList,
)

Source from the content-addressed store, hash-verified

2611static mut AUDIO_UNIT: Option<AudioUnitInstance> = None;
2612
2613unsafe extern "C" fn audio_render_callback(
2614 _in_ref_con: *mut c_void,
2615 _io_action_flags: *mut u32,
2616 _in_time_stamp: *const c_void,
2617 _in_bus_number: u32,
2618 in_number_frames: u32,
2619 io_data: *mut AudioBufferList,
2620) -> OSStatus {
2621 let buffer_list = &mut *io_data;
2622 let buffer = &mut buffer_list.buffers[0];
2623 let num_samples = in_number_frames as usize * 2;
2624 let output = std::slice::from_raw_parts_mut(buffer.data as *mut f32, num_samples);
2625 ENGINE.get_mut().map(|eng| { eng.audio.mix_output(output); });
2626 0
2627}
2628
2629#[no_mangle]
2630pub extern "C" fn bloom_init_audio() {

Callers

nothing calls this directly

Calls 2

get_mutMethod · 0.80
mix_outputMethod · 0.80

Tested by

no test coverage detected