-
-
Notifications
You must be signed in to change notification settings - Fork 212
GB_set_sample_rate
void GB_set_sample_rate(GB_gameboy_t *gb, unsigned sample_rate);
void GB_set_sample_rate_by_clocks(GB_gameboy_t *gb, double cycles_per_sample);
unsigned GB_get_sample_rate(GB_gameboy_t *gb);
In apu.h
GB_set_sample_rate
and GB_set_sample_rate_by_clocks
control the output sample rate of an emulator instance. GB_set_sample_rate
sets the sample rate in Hz, and GB_set_sample_rate_by_clocks
sets it by the number of APU ticks each sample should last. The APU normally ticks at 2MHz (2,097,152Hz) when emulating a non-Super Game Boy model without overclocking or underclocking.
GB_get_sample_rate
will return the current sample rate in Hertz.
GB_set_sample_rate
must not be called if the instance is being run in another thread, but may be called from the current one (via a callback).
The default sample rate is 0
, which disables audio rendering.