From e02b68cdf8c2e8a0f369136ec72554491e1d6491 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Thu, 28 Nov 2024 22:35:52 +0200 Subject: [PATCH] Updated GB_apu_set_sample_callback (markdown) --- GB_apu_set_sample_callback.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/GB_apu_set_sample_callback.md b/GB_apu_set_sample_callback.md index 9a50c1f..3e00d80 100644 --- a/GB_apu_set_sample_callback.md +++ b/GB_apu_set_sample_callback.md @@ -4,14 +4,23 @@ 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); +void GB_apu_set_sample_callback([[GB_gameboy_t]] *gb, GB_sample_callback_t callback); In `apu.h` ## Description -TBD +This function sets a callback that's whenever the emulator instance has a rendered sample ready. The rate in which the callback is called is controlled by the [[sample rate|GB_set_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 + +* [[GB_sample_t]] +* [[GB_set_sample_rate]] \ No newline at end of file