I want to listen to a sound by using FMOD in a function.. I want to say before that I can hear all my other sounds but they are not used with a function.
here is an extract of the code :
header.h
void leson(FMOD_SOUND *caisse);
and now the code :
#include <fmod.h>
FMOD_SYSTEM *system;
FMOD_SOUND *caisse;
FMOD_RESULT resultat8;
FMOD_System_Create(&system);
FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL);
resultat8 = FMOD_System_CreateSound(system, "sound/caisse.wav", FMOD_CREATESAMPLE, 0, &caisse);
if (resultat8 != FMOD_OK)
{
fprintf(stderr, "error");
exit(EXIT_FAILURE);
}
I want to use the key V to call the function leson()
switch(event.type)
{
case SDL_KEYDOWN:
switch(event.key.keysym.sym)
{
case SDLK_v:
leson(&caisse);
break;
here is leson()
void leson(FMOD_SOUND *caisse)
{
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, caisse, 0, NULL);
fprintf(stderr, "test");
}
When I press V the file stderr contains the line test so the switch is ok, but why I cant hear this sound ?