Check if no MIDI sounds could be played
This commit is contained in:
parent
ebdf360f69
commit
599bfa0331
2 changed files with 12 additions and 1 deletions
|
@ -17,7 +17,7 @@ Aucune...
|
||||||
>
|
>
|
||||||
> ```bash
|
> ```bash
|
||||||
> sudo mkdir -p /usr/share/sounds/sf2
|
> 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_ttf`
|
||||||
- `SDL2_image`
|
- `SDL2_image`
|
||||||
|
|
11
src/audio.c
11
src/audio.c
|
@ -26,6 +26,17 @@ void initMusic(Mix_Chunk *music, const char *filename) {
|
||||||
exit(_errStatus);
|
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)) {
|
if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 1, 2048)) {
|
||||||
fprintf(stderr, "Erreur Mix_OpenAudio\n");
|
fprintf(stderr, "Erreur Mix_OpenAudio\n");
|
||||||
exit(_errStatus);
|
exit(_errStatus);
|
||||||
|
|
Reference in a new issue