Fixed wrong type of phase (#12014)

`phase` should be a `float` value that ranges between `0` and `1`.
This commit is contained in:
Nicolas Firmo 2025-01-17 23:12:47 -03:00 committed by GitHub
parent b95989d14a
commit 842f6dc402
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -36,7 +36,7 @@ static void SDLCALL FeedTheAudioStreamMore(void *userdata, SDL_AudioStream *astr
/* generate a 440Hz pure tone */
for (i = 0; i < total; i++) {
const int freq = 440;
const int phase = current_sine_sample * freq / 8000.0f;
const float phase = current_sine_sample * freq / 8000.0f;
samples[i] = SDL_sinf(phase * 2 * SDL_PI_F);
current_sine_sample++;
}