mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-31 08:57:40 +00:00
examples: Use SDL_GetAudioStreamQueued, not SDL_GetAudioStreamAvailable.
The "available" side is at the mercy of whatever format the hardware wants, but we control what we queued. Fixes #12403.
This commit is contained in:
parent
b3336c5a73
commit
f7cadcba84
3 changed files with 3 additions and 3 deletions
|
@ -69,7 +69,7 @@ SDL_AppResult SDL_AppIterate(void *appstate)
|
|||
A sine wave is unchanging audio--easy to stream--but for video games, you'll want
|
||||
to generate significantly _less_ audio ahead of time! */
|
||||
const int minimum_audio = (8000 * sizeof (float)) / 2; /* 8000 float samples per second. Half of that. */
|
||||
if (SDL_GetAudioStreamAvailable(stream) < minimum_audio) {
|
||||
if (SDL_GetAudioStreamQueued(stream) < minimum_audio) {
|
||||
static float samples[512]; /* this will feed 512 samples each frame until we get to our maximum. */
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue