在 Audiokinetic 社区问答论坛上,用户可对 Wwise 和 Strata 相关问题进行提问和解答。如需从 Audiokinetic 技术支持团队获取答复,请务必使用技术支持申请单页面。

Stream media got cannot open file after leaving a level.

+10 投票
We have an issue of streaming media does not play after leaving a level. This issue can reproduce by a clean UE4.27.1 + wwise 2021.4.7707 project.

Our environment are listed below:
Environment
    Windows 10

    wwise 2021.1.4.7707

    Unreal 4.27.1 Release from Epic Launcher

    Use Event-Based Packaging is true

 

Reproduce Steps:

1.We created two music tracks in wwise. The one is set to streaming (Audio1), and the other is set to non streaming (Audio2).

2.Create two maps in UE4. The Map1 plays Audio1 when level starts; the Map2 plays Audio2 when level starts.

3.Play with Standalone game starts with Map1. Audio1 is played.
4. Use console command open Map2 to travel the map to Map2. Audio2 is played.

5. Use console command open Map1 to travel the map to Map1. Audio1 is not played. The log shows:

LogAkAudio: Error: Cannot open file: 411434698

LogAkAudio: Error: Failed creating source: 411434698

6. Use console command open Map2 to travel the map to Map2. Audio2 is played.

 

Notes:

In step1. Not only music track, Sound SFX does not works also if the media is set to stream.

In step3. Only Play in editor works well without any issue. However, packaged game and standalone game in editor do not works.

 

Please let me know if you have already know this issue or have a fix for this.

Thank you.
最新提问 11月 10, 2021 分类:General Discussion | 用户: windkey k. (200 分)

1个回答

+3 投票
We also had this issue.  The problem we found is that any streamed media that is not flagged to be prefetched won't have bIsMediaSet set to true at any point.

Here is snippet of the change we made to UAkMediaAsset::LoadAndSetMedia() to fix this issue:

    auto& DataChunk = MediaAssetData->DataChunks[0];
    if (MediaAssetData->IsStreamed && !DataChunk.IsPrefetch)
    {
        FAkUnrealIOHook::AddStreamingMedia(this);
        LoadRefCount.Increment();

        // This flag was not being set on streamed media, causing
        // UAkMediaAsset::IsReadyForFinishDestroy to follow the wrong path during GC which
        // would prevent FAkUnrealIOHook::RemoveStreamingMedia from being called. After
        // this failure, the media asset would no longer stream properly. This flag would
        // normally be set by UAkMediaAsset::DoSetMedia however this is not run for
        // non-prefetch, streamed media due to this early out.
        bIsMediaSet = true;

        return;
    }
最新回答 3月 23, 2022 用户: John M. (200 分)
修改于 3月 23, 2022 用户:John M.
Thank you! I am happy to confirm that this works.
Adding the prefetch flag on a streamed music track fixes my "failed play" issue, will try your solution thank you!
...