diff --git a/README.md b/README.md index 6769936..ae2e298 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/src/audio.c b/src/audio.c index a9ecee6..51bdacc 100644 --- a/src/audio.c +++ b/src/audio.c @@ -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);