You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok, so thinking about this more, the problem is that SDL_AudioStream doesn't let you change output formats once you create it, but that's because we convert data as it is input. But this is silly, we should be queuing it up and converting it as we need output. This would let us do a couple of things:
You could deal with an audio device that you're feeding if it changes formats.
You can change a stream's sample rate for various pitch effects on the fly.
You could potentially have access to more resampling history at the moment you need it.
You don't spend the CPU time converting audio that you might throw away anyhow with SDL_ClearAudioStream/SDL_DestroyAudioStream.
Ah, I remember another reason why this converts/resamples during Put and not during Get.
It wasn't clear we could definitely say that there would be X samples available (if the resample ratio was weird we might estimate incorrectly), so it was easier to say "the converted data queue definitely has X bytes available for reading right now" instead of "there will be X bytes available if we converted everything currently available."
Originally posted by @icculus in #6632 (comment)
The text was updated successfully, but these errors were encountered: