Play two audio from C++ one after another

Hello,

I am downloading audio data from server and creating USoundWaveProcedural objects and playing them via UAudioComponent as follows:

Code:
this->audioComponent = FindComponentByClass();
this->audioComponent->OnAudioFinished.AddDynamic(this, &AStudioManager::handleAudioFinish);

        USoundWaveProcedural *audio = NewObject<USoundWaveProcedural>();
        audio->SetSampleRate(sampleRate);
        audio->NumChannels = numberOfChannels;
        audio->Duration = INDEFINITELY_LOOPING_DURATION;
        audio->SoundGroup = SOUNDGROUP_Voice;
        audio->bLooping = false;
        audio->QueueAudio(reqdAudioData, audioData.size());
        this->audioComponent->SetSound((USoundBase*)audio);
        this->audioComponent->Play();

It works fine.

However, my handleAudioFinish method is not called because the duration is set to INDEFINITELY_LOOPING_DURATION. I tried to not set the Duration at all and also tried setting to 0.0 but it did not help.

What can I do to make the handleAudioFinish method get called after the audio being played is finished irrespective of the audio length?

Thanks in Advance,
Akshay Shah.

Hello meetakshay99,

Can you please provide me with the full cpp, and .h file for this class?

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Thanks!

Have you tried setting the duration to the length of the audio in seconds? I think it would treat 0 the same as infinite, maybe.