Closed Caffiendish closed 1 year ago
Can you explain a little more? Are you calling "GetAudioFrameFromSoundWave" (or a similar function) on the entire sound wave buffer and trying to shut down the editor at the same time, causing a crash?
I poured in the entire file as a single frame for ProcessFrame
, then closed the preview.
Normally, you probably shouldn't be able to get that sort of event, but it is possible that the ImportedSoundWave might be destroyed (user closes window, a different level is loaded, actor is destroyed, etc) whilst analysis is happening, and before the playback is completed.
The audio buffer should be valid, as AudioAnalysisTools pre-copies it from the sound wave to avoid this error.
Perhaps the crash is due to the FFT buffers that are not valid at that time, as they could have been cleared. Check the latest commit, it might fix your issue.
This isn't normally an issue, but I'm throwing all the data at the frame process at the moment.
If you exit whilst the processing is in progress, you get this exception:
The fix is to check whether the engine is still running, I had the same issue with a plugin I made, I tried a number of things, checking to see if GEngine was valid, whether I could get a valid world pointer, the only thing that reliably worked was a bool, that would be checked before taking action, and set when the destructor was called, for example. I had to use this for the editor preview, otherwise it skipped my destructor:
If you have/find a better solution, I'd love to know, my bool workaround feels very "hacky"!