ref: a5b5d353d0249aca82251c8f01b3fae8f750ec67
parent: 126b1529fd246a68f73b538a8a02dc2772a0e5ed
author: Olav Sørensen <olav.sorensen@live.no>
date: Sat May 13 09:13:58 EDT 2023
Update pt2_audio.c
--- a/src/pt2_audio.c
+++ b/src/pt2_audio.c
@@ -474,10 +474,10 @@
want.callback = audioCallback;
want.userdata = NULL;
- dev = SDL_OpenAudioDevice(NULL, 0, &want, &have, 0);
+ dev = SDL_OpenAudioDevice(NULL, 0, &want, &have, SDL_AUDIO_ALLOW_ANY_CHANGE);
if (dev == 0)
{
- showErrorMsgBox("Unable to open audio device: %s", SDL_GetError());
+ showErrorMsgBox("Couldn't open audio device:\n\"%s\"\n\nDo you have an audio device enabled and plugged in?", SDL_GetError());
return false;
}
@@ -489,9 +489,9 @@
return false;
}
- if (have.format != want.format)
+ if (have.format != AUDIO_S16)
{
- showErrorMsgBox("Unable to open audio: The sample format (signed 16-bit) couldn't be used!");
+ showErrorMsgBox("Couldn't open audio device:\nThis program only supports 16-bit audio streams. Sorry!");
return false;
}