gtreshchev / RuntimeAudioImporter

Runtime Audio Importer plugin for Unreal Engine. Importing audio of various formats at runtime.
MIT License
308 stars 67 forks source link

Streaming sound wave component being destroyed #66

Closed ApoorvHesta closed 3 months ago

ApoorvHesta commented 3 months ago

Hey everyone, As wonderful this plugin is, I'm getting random app crashes saying Streaming Sound Component is destroyed so cannot Populate Voice data. Anyone has any insight in this?

gtreshchev commented 3 months ago

Please make sure that you populate the created sound wave into a separate variable, as it is always shown in the documentation, to avoid garbage collection.

ApoorvHesta commented 3 months ago

Yeah I am populating in CapturableSoundWave type variable and reinitializing it each time on calling StartListening()

gtreshchev commented 3 months ago

Please share your setup

gtreshchev commented 3 months ago

Yeah I am populating in CapturableSoundWave type variable and reinitializing it each time on calling StartListening()

If you store the sound wave as a separate variable in Blueprints or as a strong pointer in C++ (such as UPROPERTY and TStrongObjectPtr), the referenced sound wave won't be garbage collected during this time.