Pause FMOD thread


(Vladimir) #1

Hi, everyone!

I using FMOD 5 low level api, to play sound in my game. As render engine I using the PlayFirst Playground SDK. On each frame I updating my sound manager(wrapper for FMOD). But I have one little problem. When i hitting Win+L on Win8, engine stop receiving messages in window message loop. So I cann’t stop Fmod system, and sound still playing, while all game thread paused. Can you help please to resolve that problem? Also i does not have access to message loop, cause impletementation of SDK not presenting sources for message loop.
I also trying to SetWindowHookEx and trying to receive messages, but i still fail.

How I can sync FMOD thread with main thread?


(Nicholas Wilcox) #2

You can detect the desktop being locked in the windows message loop. Then use System::getMasterChannelGroup() and ChannelGroup::setPaused() to pause all audio.


(Vladimir) #3

When i hitting Win+L on Win8, engine stop receiving messages in window message loop. So I cann’t stop Fmod system.


(Nicholas Wilcox) #4

You can get a message from windows when the desktop is locked. If you cannot get such a message in your engine I suggest contacting that developer for support.


(Vladimir) #5

This engine no supporting (since 2009). But I found solution alredy. I create thread which monitoring state of rendering. And if update thread paused, I pausing sound enginge.