I have a class extended from USoundWaveProcedural:
// HEADER
UCLASS()
class UMySoundWave : public USoundWaveProcedural
{
GENERATED_UCLASS_BODY()
public:
bool Initialize();
};
//CODE
UMySoundWave::UMySoundWave(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {}
bool UMySoundWave::Initialize()
{
uint32 BytesRead;
uint8 *AudioBuffer = ...;// HERE: GENERATE PCM DATA AND FILL BytesRead
NumChannels = 1;
SampleRate = 44100;
Duration = (BytesRead / 2) / 44100.0;
SoundGroup = SOUNDGROUP_Voice;
QueueAudio(AudioBuffer, BytesRead);
delete AudioBuffer;
return true;
}
The problem is when I use SpawnSoundAttached with this sound, OnAudioFinished never called.