Hi,
After I updated from Fmod ex to Fmod studio I can’t make the setpaused funtion work. I am working in C with Visual Express 2010. I have made the following program to illustrate:
switch(msg)
{
case WM_CREATE:
result = FMOD_System_Create(&systemx);
FMOD_System_Init(systemx, 512, FMOD_INIT_NORMAL, NULL);
result = FMOD_System_CreateSound(systemx, "harmonium0.wav", FMOD_CREATESAMPLE | FMOD_LOOP_NORMAL | FMOD_2D, 0, &sound[0]);
Control[0] = CreateWindow(TEXT("button"), TEXT("Play"),
WS_VISIBLE | WS_CHILD,
200, 200, 50, 50,
hwnd, (HMENU) 1, NULL, NULL);
Control[1] = CreateWindow(TEXT("button"), TEXT("Stop"),
WS_VISIBLE | WS_CHILD,
250, 200, 50, 50,
hwnd, (HMENU) 2, NULL, NULL);
case WM_COMMAND:
if (LOWORD(wParam) == 1) {
result = FMOD_System_PlaySound(systemx, sound[0], NULL, 1, &channel[0]);
result = FMOD_Channel_SetPaused(channel[0], 0);
FMOD_Channel_GetPaused(channel[0], paused);
}
if (LOWORD(wParam) == 2) {
result = FMOD_Channel_SetPaused(channel[0], 1);
result = FMOD_Channel_GetPaused(channel[0], paused);
return 0;
}
return 0;
case WM_DESTROY:
PostQuitMessage(0);
FMOD_System_Release(systemx);
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
When clicking the first button, there is no sound. The return values are OK and the paused variable is 0. If I remove the first instance of setpaused and start playing directly from the playsound function, there is sound, but when clicking the second button the sound doesn’t stop. Also then the return values are ok and the paused value is 0.
Hope someone can help me with this.
Thanks in advance.
Sincerely
Keitel