Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

+10 votes
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.
in General Discussion by windkey k. (200 points)

1 Answer

+3 votes
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;
    }
by John M. (200 points)
edited by 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!
...