Audiokinetic Wwise Knowledge Base

Why changing the focus while initializing the sound engine can make the sound engine to be silent?

(PC only)

When initializing the sound engine, the game must provide a valid HWND to the initialization of the sound engine in the AkPlatformInitSettings.

If you are using AK::SoundEngine::GetDefaultPlatformInitSettings() to initialize the parameters (which is a good thing by the way), it returns the default parameters to use, and then you simply have to replace the parameters you want to change specifically for your game.

The parameter "hWnd" returned by default is the result of a call to ::GetForegroundWindow( ).

And this function will return an invalid handle if no window currently has the main focus.

Each game should provide a valid "hWnd" in the init settings for the game instead of relying on the current foreground window.

Occasionnally, passing an invalid hWnd results in failure to initialize the sound engine, and this assert pops up in Debug: !"Unable to set cooperative level".




Article Details

Last Updated
23rd o February, 2010

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (2 votes)

100% thumbs up 0% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Continue