Bonjour,
Je réalise un jeu, et j'ai un problème avec le son.
Je voudrais jouer plusieurs sons en même temps et qu'au début de la partie que son soit déjà en mémoire.
J'ai essayé avec PlaySound :
Quand le son est exécuté la première fois, le jeu saccade car il n'est pas en mémoire.
Avec fmod, je n'arrive pas à jouer 2 sons en même temps.
J'ai ajouté un autre
m_soundChannel2, ça ne donne rien. J'ai toujours un son sur deux qui fonctionne
.
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
int
m_soundChannel1, m_soundChannel2;
FSOUND_SAMPLE *mp3a *mp3b;
HDC hdc, hdcMem;
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
FSOUND_Init(44100, 1, FSOUND_INIT_GLOBALFOCUS);
mp3a = FSOUND_Sample_Load(FSOUND_FREE, "sound\\Song1.mp3", 0, 0);
m_soundChannel1 = FSOUND_PlaySound(FSOUND_FREE, mp3a);
FSOUND_SetLoopMode(0,FSOUND_LOOP_NORMAL);
FSOUND_Init(44100, 1, FSOUND_INIT_GLOBALFOCUS);
mp3b = FSOUND_Sample_Load(FSOUND_FREE, "sound\\Song2.mp3", 0, 0);
m_soundChannel2 = FSOUND_PlaySound(FSOUND_FREE, mp3b);
FSOUND_SetLoopMode(0,FSOUND_LOOP_NORMAL);
Merci beaucoup
@+