Announcement

Collapse
No announcement yet.

How to spatialize a Procedural and Generated wave sound with UE >4.21?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to spatialize a Procedural and Generated wave sound with UE >4.21?

    Until UE 4.19.2 I was able to spatialize the user's voice chat: when entering the multiplayer level I took the player's voice (an AudioComponent), deactivate it, set spatialization/attenuation features and re-activate it. The deactivation/activation trick was necessary because the attenuation/spatialization settings are initialized once and are not applied if I set them while the audio is playing.

    With UE 4.21 a block of code has been added (actually with UE 4.20, but it has been modified in UE 4.21) in the class FAudioDevice, inside of the method AddNewActiveSound(FActiveSound&):
    Code:
    USoundWave* SoundWave = Cast<USoundWave>(Sound);
    if (SoundWave && SoundWave->bProcedural && SoundWave->IsGenerating())
    {
    FString SoundWaveName;
    SoundWave->GetName(SoundWaveName);
    UE_LOG(LogAudio, Warning, TEXT("Replaying a procedural sound '%s' without stopping the previous instance. Only one sound instance per procedural sound wave is supported."), *SoundWaveName)
    return;
    }
    This block prevents the sound from being played "again", but, actually, if the audio has been stopped it can't be resumed because it is always "generating", so that check always succeeds and the following code is not executed. Is this a bug or am I missing something?
    Last edited by masmil1988; 04-17-2019, 10:09 AM.
Working...
X