Alors voila j´ai installé FMOD et j´ai entreé le code ci-dessous mais quand j´appuie sur "a" rien ne se passe.
Voici mon code:
- include <stdlib.h>
- include <stdio.h>
- include <SDL/SDL.h>
- include <FMOD/fmod.h>
void pause();
int main(int argc, char *argv[])
{
int continuer = 1;
SDL_Event event;
SDL_Surface *ecran = NULL;
SDL_Init(SDL_INIT_VIDEO);
ecran = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);
SDL_WM_SetCaption("Alphabet",NULL);
SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 10, 10, 255));
SDL_Flip(ecran); /* Mise à jour de l´écran avec sa nouvelle couleur */
FSOUND_SAMPLE *a = NULL;
FSOUND_Init(44100, 32, 0);
a = FSOUND_Sample_Load(FSOUND_FREE, "a.wav", 0, 0, 0);
if (a == NULL)
{
fprintf(stderr, "Impossible de lire pan.wavn");
exit(EXIT_FAILURE);
}
switch(event.type)
{
case SDL_QUIT:
continuer = 0;
break;
case SDL_KEYDOWN:
switch(event.key.keysym.sym)
{ case SDLK_a:
FSOUND_PlaySound(FSOUND_FREE, a);
break;
}
break;
}
FSOUND_Close();
pause();
SDL_Quit();
return 0;
}
void pause()
{
int continuer = 1;
SDL_Event event;
while (continuer)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
continuer = 0;
}
}
}