Hey there,
I’ve got a question about Threading. I checked out the normal Multithread Wiki post by Rama and the TaskGraph:
What do you want to achieve?
I want to be able to Decompress Audio, not one Audio file after another, but 1 to N different amounts of Audio files at the same time. I already got i working via the “How to Create Threads in UE4” Wiki entry.
But for that, I currently need to start that one thread, have a Timer listen to the Thread and then, after the Thread is finished, start the next one.
That’s why i checked out the TaskGraphSystem. While the Threads getting called, i can’t really access the Tasks.
Inside of the Decompress Function, that will be called in the Run,DoWork or what ever it’s called, function, i use a USoundWave Pointer which i use and fill with data. The USoundWave Object will get passed when creating the thread, data will be used, data will be filled and the USoundWave Object needs to get back to the original class that created the Thread.
The class is a UActorComponent Child. It loads a SoundFile from the HDD, packs the compressed Data into the USoundWave object and then starts a Thread to decompress it. And i want to load multiple at the same time.
But i can’t manage to access the Task from the TaskGraph. And if i pass the task a Pointer to the ActorComponent and let it call and pass the USoundWave Object back to the Component, it crashs.
So i can’t manage to get the USoundWave pointer back from the Task.
Can anyone guide me into the correct direction of what to use how to?
- 1 or Multiple Threads simultaneously
- Pass USoundWave Pointer on Creation
- Get USoundWave Pointer back after Thread finished
That’s “all” i need.
If you need more information, please tell me (: