Loading .WAV at runtime to a USoundWave

After debugging, i found that setting the decompression type is the cause of this error:


ERROR: Assertion failed: Wave->GetPrecacheState() == ESoundWavePrecacheState::Done [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/Windows/XAudio2/Private/XAudio2Buffer.cpp] [Line: 364]




//editing out this code has seemed to stop causing the error

sw->DecompressionType = EDecompressionType::DTYPE_RealTime;