AudiokineticのコミュニティQ&AはWwiseやStrataのコミュニティ内でユーザ同士が質問・回答をし合うことができるフォーラムです。Audiokineticテクニカルサポートチームからの回答をご希望の場合は、必ず サポートチケットページ をご利用ください。

0 支持

I have just started a new game project with Wwise and was wondering what the best practice is for dealing with suppressing audio when the game window is in the background.

This game is on Windows and I found this documentation describing how to handle the issue on Windows. I'm not too certain how to provide the hWnd of my game window properly, though. Or if I should be using Suspend() to deal with this somewhere instead. I've tried a few solutions, but none of them seem to work. Any suggestions on how to handle this?

Thanks! 

Megan S. (490 ポイント) General Discussion

回答 1

+1 支持
 
ベストアンサー
firstly setup an rtpc and you will use to change the sounds you want to change when the window doesn't have focus - e.g 100 window in focus 0 window not in focus ( 99-1 fades between the two ) - this might be as simple as controlling the master bus volume.

secondly realize that now just need to set this rtpc ( with a fade ) to either 100 or 0 depending on if the window has focus.

lastly you need to find the point in your engine where you can detect when this changes most have this for some other reason so dig around - you might need to add this, in which case it will depend upon the platform for windows start by looking at WM_SIZE https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-size - hopefully its clear that this part is nothing really to do with wwise but more of a general engine thing to call code that wants to run when the window comes and goes.

hope that helps

-

dan.murray
Dan M. (2.6k ポイント)
Megan S. 選択
This was very helpful, thank you!
...