gtreshchev / RuntimeAudioImporter

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

Multiple Audio components #62

Closed mhassan34 closed 8 months ago

mhassan34 commented 8 months ago

I have multiple audio components, i am setting their sound at runtime with importer, when i play single audio component it works, playing all audio components together with same importer isn't working. Screenshot 2024-02-02 162247

gtreshchev commented 8 months ago

This is due to the nature of the USoundWaveProcedural, which serves as the basis for the plugin's UImportedSoundWave. One potential solution is to create a function for duplicating a sound wave with the option to share the same resources between them (to prevent allocating memory for the audio buffer for a separate sound wave). I had such plans in the past, and it appears that the current state of the plugin is already conducive to implementing that feature. Thanks for bringing it to my attention :)

gtreshchev commented 8 months ago

Should be addressed at https://github.com/gtreshchev/RuntimeAudioImporter/commit/31474509ca97c04481bd830b8b7bc7b38e31f77c Now you can duplicate a sound wave while avoiding the allocation of a separate audio buffer (if you choose to use the shared audio buffer): https://github.com/gtreshchev/RuntimeAudioImporter/wiki/1.1.-Sound-Wave-Duplication image

mhassan34 commented 8 months ago

Thanks a lot.