Skip to content

SDL.Audio: Fix openAudioDevice Changeable check #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2021

Conversation

spinnylights
Copy link
Contributor

This is a simple bugfix. foldChangeable expects the value for Mandate as its first argument and the value for Desire as its second, but changes in openAudioDevice had them reversed, so this simply swaps the two values there.

I noticed this when trying to run audio-example. I use JACK as my SDL audio driver; JACK expects samples as 32-bit floats. Under those circumstances, SDL will set the audio format to AUDIO_F32 unless you insist otherwise. As written, audio-example was erroring out with "unsupported audio format" as a result of this, because Mandate Signed16BitNativeAudio was actually setting SDL_AUDIO_ALLOW_FORMAT_CHANGE. With this fix, audio-example runs properly in my environment.

`foldChangeable` expects the value for Mandate as its first argument and
the value for Desire as its second, but `changes` in `openAudioDevice`
had them reversed. Swap them.
@ocharles ocharles merged commit 267a291 into haskell-game:master Nov 7, 2021
@ocharles
Copy link
Member

ocharles commented Nov 7, 2021

Thanks, and sorry this took so long to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants