SoundCue Random Node crashes unless asset opened

Hi all,

We have encountered a strange edge case usage of Sound Cues which cause an engine crash, but only if you haven’t opened the Sound Cue asset while the editor is running. If you do not open the Sound Cue and play Sound Cue in game, it crashes! It also crashes every time in a build.

Setup:

Create a SoundCue with the above layout. It specifically requires a Concatanator, a branch, and then Random nodes plugged into the Branch. If you remove the Concatanator, the crash goes away. If you remove the Branch, the crash goes away. If you remove the Random nodes, the crash goes away.

So here’s the strange part. If you have opened the SoundCue in the editor before attempting to play the SoundCue then it will not crash when you play the SoundCue in a level or from a blueprint. However, if you restart the editor and immediately play the SoundCue from the level/blueprint then you will get an editor crash.

Reproduction:

Download the [project attached][2] to this post (a whopping 1.2mb unzipped) and open it in Unreal 4.12.5, open the “ExampleScene” scene. It has the BP_AudioBranchTest blueprint in it, which simply sets the Boolean Parameter on the Branch, and then tells the node to play. Press Play. The audio will play until it hits the Branch, and then the editor will crash. Restart Unreal, and this time, open “ExampleScene”, and then open SC_CrashingSoundCue. Now, hit “Play” and the Audio Cue will play both the concatenated sentence and the random node.

Also, if you try to preview the Audio Cue the crash will not happen, because it does not have any way to preview the parameters of the Branch so it uses the unset version.

Crash Callstack:

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 804] 
Array index out of bounds: 0 from an array of size 0


UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:440]
UE4Editor_Engine!USoundNodeRandom::ChooseNodeIndex() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\soundnoderandom.cpp:94]
UE4Editor_Engine!USoundNodeRandom::GetNumSounds() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\soundnoderandom.cpp:181]
UE4Editor_Engine!USoundNode::GetNumSounds() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\soundnode.cpp:165]
UE4Editor_Engine!USoundNodeConcatenator::ParseNodes() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\soundnodeconcatenator.cpp:158]
UE4Editor_Engine!FActiveSound::UpdateWaveInstances() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\activesound.cpp:271]
UE4Editor_Engine!FAudioDevice::GetSortedActiveWaveInstances() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\audiodevice.cpp:2270]
UE4Editor_Engine!FAudioDevice::Update() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\audiodevice.cpp:2560]
UE4Editor_Engine!FAudioDeviceManager::UpdateActiveAudioDevices() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\engine\private\audiodevicemanager.cpp:276]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:1554]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\editor\unrealed\private\unrealedengine.cpp:368]
UE4Editor!FEngineLoop::Tick() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2775]
UE4Editor!GuardedMain() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\launch.cpp:148]
UE4Editor!GuardedMainWrapper() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Conclusion:

We’ve worked around it for now by removing the random nodes, but uh… good luck chasing this one down!

Hey ,

Thanks for the clear and precise repro steps. I was able to confirm what you are reporting and have gone ahead and entered a bug report for the issue. You can track the issue following the link below on our new Public Issues Tracker.

UE-35055

Once the issue has been addressed by our engineers, the fix will be added to the release notes for fixed issues within an upcoming full engine or hotfix release.

Let me know if you have further questions or need additional assistance.

Cheers,

Andrew Hurley