社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

+1 投票
I have a character that has ambient sounds come from them. Unfortunately these, and all other sounds, stop when leaving a level streaming volume in UE4. The stop all event is called.  Where can we intercept this and make it so that the stop all function is not called? Or a way that we can change it, that if a level is unloaded/destroyed in this fashion?

 

-Rob
分类:General Discussion | 用户: Robert M. (4.6k 分)
修改于 用户:Robert M.

2 个回答

+3 投票
Hi Rob, i'm having a similar issue. What i found out is that AkAudioDevice registers to the LevelRemovedFromWorld callback. If this callback is called, AkAudioDevice will call its flush method and, like you said, will call StopAll from wwise api.

In our case, we are streaming levels when moving forward in the map. When the streaming happens, the callback gets called.

I didn't find any solution for our specific case. I might try filtering the Flush method if some specific levels are removed but not all.

I would be curious to know if you found any solution to your problem.

Cheers,
用户: Francois P. (200 分)
We ran into a similar problem and had to comment out the implementation of FAkAudioDevice::OnLevelRemoved to avoid the unwanted StopAll calls interfering with, say, looping ambient sounds as various unrelated sub-levels were loaded and unloaded into the main level.  Rather, we called Flush directly from higher-level logic in our game module explicitly associated with the main level unload.  Game-specific to be sure, but equivalent to Fracois’ suggestion of adjusting OnLevelRemoved’s behaviour dependent on Inlevel.
+1 投票
void FAkAudioDevice::OnLevelRemoved(ULevel* InLevel, UWorld* InWorld)
{
    if (InLevel && InLevel->IsPersistentLevel())
    {
        Flush(NULL);
    }
}

 

 

Hey guys ^ that is the code my programmer was able to implement in akaudiodevice.cpp. He just recently learned about level unloading and loading so was finally able to help me out on this one. But this code basically checks if the level is the main persistent level. If so then unload, if not then don't unload. This has one draw back though, certain sounds say like ambient sounds in a room that should not continue on in another room do not turn off. So you will just have to create a custom BP to take care of that for you so you don't overload the system.

 

-Rob
用户: Robert M. (4.6k 分)
Thanks for following up Robert. This should do the trick. On our side, we simply removed the flush since they were no drawback of doing so in the context of our game.
Thanks for the follow up Robert as I just discovered this today.

Sadly I haven't got time to dig more into this to see how it's should be properly be used.
Hi there, we are in 2022, am I wrong saying this issue is still true ? I have the exact same issue and can't figure out other solution than maybe adding this piece of code...
In our system, we could see that this bug was fixed in 2016.1.2 as "WG-30304 Fixed: "Unload stream level" no longer posts a global "Stop All" to the SoundEngine."
https://www.audiokinetic.com/library/2019.2.14_7616/?source=UE4&id=releasenotes_2016_1_2.html
If you are encountering this issue, you might be facing a different issue or this issue came back as a side-effect of other changes. You can report the issue through a Bug Report (https://www.audiokinetic.com/library/edge/?source=InstallGuide&id=reporting_bugs) where you can share how you reproduce the issue and which versions of the product you are using.
...