mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-30 16:37:39 +00:00
![]() Audio distortion after a while caused by loss of precision in dividing a large floating point number resolved by keeping `current_sine_sample` (formelly named `total_samples_generated`) between 0 and freq - 1. |
||
---|---|---|
.. | ||
README.txt | ||
simple-playback-callback.c |
If you're running this in a web browser, you need to click the window before you'll hear anything! This example code creates an simple audio stream for playing sound, and generates a sine wave sound effect for it to play as time goes on. Unlike the previous example, this uses a callback to generate sound.