Check if no MIDI sounds could be played

This commit is contained in:
Mylloon 2023-05-04 11:03:48 +02:00
parent ebdf360f69
commit 599bfa0331
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 12 additions and 1 deletions

View file

@ -17,7 +17,7 @@ Aucune...
>
> ```bash
> sudo mkdir -p /usr/share/sounds/sf2
> sudo ln -sf /usr/share/soundfonts/*.sf2 /usr/share/sounds/sf2/
> sudo ln -s /usr/share/soundfonts/*.sf2 /usr/share/sounds/sf2/
> ```
- `SDL2_ttf`
- `SDL2_image`

View file

@ -26,6 +26,17 @@ void initMusic(Mix_Chunk *music, const char *filename) {
exit(_errStatus);
}
if (!Mix_GetSoundFonts()) {
fprintf(stderr,
"Aucun soundfonts, mettez les dans /usr/share/sounds/sf2\n");
fprintf(stderr,
"S'ils sont dans /usr/share/soundfonts, "
"vous pouvez faire :\n"
"sudo mkdir -p /usr/share/sounds/sf2 && "
"sudo ln -s /usr/share/soundfonts/*.sf2 /usr/share/sounds/sf2/\n");
exit(_errStatus);
}
if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 1, 2048)) {
fprintf(stderr, "Erreur Mix_OpenAudio\n");
exit(_errStatus);