Skip to content

GB_apu_set_sample_callback

Lior Halphon edited this page Nov 30, 2024 · 4 revisions

Definition

typedef void (*GB_sample_callback_t)(GB_gameboy_t *gb, GB_sample_t *sample);

void GB_apu_set_sample_callback(GB_gameboy_t *gb, GB_sample_callback_t callback);

In apu.h

Description

This function sets a callback that triggers whenever the emulator instance has a rendered sample ready. The rate at which the callback is called is controlled by the sample rate.

Thread Safety

GB_apu_set_sample_callback is thread-safe and can be called from any thread and context.

Notes

The callback isn't called when the sample rate is set to 0.

See Also

Clone this wiki locally