Ensure Condition Failed: IsInAudioThread() Error From Blueprints

Hey guys I’m currently experiencing some issues with audio in my packaged project. I have a widget blueprint set up that contains all of my application’s main settings. One of the widgets inside of it is a section for adjusting audio settings. Specifically, I create an “audio channel” for the different Sound Classes that I have in the project. Within each of these channels you can adjust the overall volume and you can also adjust which Source Effects are being applied to them by adjusting the preset chain that they reference.

The audio engine seems to be upset that I am removing source effects from a preset chain at runtime within this widget. When I construct the widget for the first time while running the exe I noticed that there is consistently a hiccup in the frame rate and it is because it is shooting this error out:

LogStats: FPlatformStackWalk::StackWalkAndDump - 0.311 s
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error:
LogOutputDevice: Ensure condition failed: IsInAudioThread()Error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\AudioMixer\Private\AudioMixerDevice.cpp] [Line: 195]
LogOutputDevice: Error:
LogOutputDevice: Error: Stack:
exe!Audio::FMixerSourceManager::AudioMixerThreadCommand() []
exe!Audio::FMixerDevice::UpdateSourceEffectChain() []
exe!UAudioMixerBlueprintLibrary::RemoveSourceEffectFromPresetChain() []
exe!UAudioMixerBlueprintLibrary::execRemoveSourceEffectFromPresetChain() []
exe!UObject::execCallMathFunction() []

It seems to be complaining that I did not ensure something was being called in the audio thread but all I did was use the blueprint library functions with no C++ involved. Is this normal behavior? Does anyone know how to get around this? Am I making a mistake by using those blueprint functions in the wrong place (such as within a widget)?

Any help would be appreciated. Thanks.

In case this would help, this is the blueprint function (“Remove Source Effect From Preset Chain”) that I’m calling that seems to be causing this issue.

Does anyone have any thoughts on this? Thank you.

Turns out that I was calling the “Remove Source Effect from Preset Chain” via an “On Current index Changed” broadcast which caused the ensure condition to fail. By avoiding calling it through this method the issue went away.