Updated GB_apu_set_sample_callback (markdown)

Lior Halphon 2024-11-28 22:35:52 +02:00
parent 2d14f09219
commit e02b68cdf8
1 changed files with 11 additions and 2 deletions

@ -4,14 +4,23 @@
typedef void (*GB_sample_callback_t)(GB_gameboy_t *gb, GB_sample_t *sample);
```
<tt>void GB_apu_set_sample_callback([[GB_gameboy_t]] *gb, [[GB_sample_callback_t]] callback);</tt>
<tt>void GB_apu_set_sample_callback([[GB_gameboy_t]] *gb, GB_sample_callback_t callback);</tt>
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]]