本文整理汇总了C++中FActiveSound::ApplyRadioFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ FActiveSound::ApplyRadioFilter方法的具体用法?C++ FActiveSound::ApplyRadioFilter怎么用?C++ FActiveSound::ApplyRadioFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FActiveSound
的用法示例。
在下文中一共展示了FActiveSound::ApplyRadioFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parse
void USoundWave::Parse( FAudioDevice* AudioDevice, const UPTRINT NodeWaveInstanceHash, FActiveSound& ActiveSound, const FSoundParseParameters& ParseParams, TArray<FWaveInstance*>& WaveInstances )
{
FWaveInstance* WaveInstance = ActiveSound.FindWaveInstance(NodeWaveInstanceHash);
// Create a new WaveInstance if this SoundWave doesn't already have one associated with it.
if( WaveInstance == NULL )
{
if( !ActiveSound.bRadioFilterSelected )
{
ActiveSound.ApplyRadioFilter( AudioDevice, ParseParams );
}
WaveInstance = HandleStart( ActiveSound, NodeWaveInstanceHash);
}
// Looping sounds are never actually finished
if (bLooping || ParseParams.bLooping)
{
WaveInstance->bIsFinished = false;
#if !NO_LOGGING
if (!ActiveSound.bWarnedAboutOrphanedLooping && !ActiveSound.AudioComponent.IsValid())
{
UE_LOG(LogAudio, Warning, TEXT("Detected orphaned looping sound '%s'."), *ActiveSound.Sound->GetName());
ActiveSound.bWarnedAboutOrphanedLooping = true;
}
#endif
}
// Check for finished paths.
if( !WaveInstance->bIsFinished )
{
// Propagate properties and add WaveInstance to outgoing array of FWaveInstances.
WaveInstance->Volume = ParseParams.Volume * Volume;
WaveInstance->VolumeMultiplier = ParseParams.VolumeMultiplier;
WaveInstance->Pitch = ParseParams.Pitch * Pitch;
WaveInstance->HighFrequencyGain = ParseParams.HighFrequencyGain;
WaveInstance->bApplyRadioFilter = ActiveSound.bApplyRadioFilter;
WaveInstance->StartTime = ParseParams.StartTime;
WaveInstance->UserIndex = ActiveSound.UserIndex;
WaveInstance->OmniRadius = ParseParams.OmniRadius;
bool bAlwaysPlay = false;
// Properties from the sound class
WaveInstance->SoundClass = ParseParams.SoundClass;
if (ParseParams.SoundClass)
{
FSoundClassProperties* SoundClassProperties = AudioDevice->GetSoundClassCurrentProperties(ParseParams.SoundClass);
// Use values from "parsed/ propagated" sound class properties
WaveInstance->VolumeMultiplier *= SoundClassProperties->Volume;
WaveInstance->Pitch *= SoundClassProperties->Pitch;
//TODO: Add in HighFrequencyGainMultiplier property to sound classes
WaveInstance->VoiceCenterChannelVolume = SoundClassProperties->VoiceCenterChannelVolume;
WaveInstance->RadioFilterVolume = SoundClassProperties->RadioFilterVolume * ParseParams.VolumeMultiplier;
WaveInstance->RadioFilterVolumeThreshold = SoundClassProperties->RadioFilterVolumeThreshold * ParseParams.VolumeMultiplier;
WaveInstance->StereoBleed = SoundClassProperties->StereoBleed;
WaveInstance->LFEBleed = SoundClassProperties->LFEBleed;
WaveInstance->bIsUISound = ActiveSound.bIsUISound || SoundClassProperties->bIsUISound;
WaveInstance->bIsMusic = ActiveSound.bIsMusic || SoundClassProperties->bIsMusic;
WaveInstance->bCenterChannelOnly = ActiveSound.bCenterChannelOnly || SoundClassProperties->bCenterChannelOnly;
WaveInstance->bEQFilterApplied = ActiveSound.bEQFilterApplied || SoundClassProperties->bApplyEffects;
WaveInstance->bReverb = ActiveSound.bReverb || SoundClassProperties->bReverb;
WaveInstance->OutputTarget = SoundClassProperties->OutputTarget;
bAlwaysPlay = ActiveSound.bAlwaysPlay || SoundClassProperties->bAlwaysPlay;
}
else
{
WaveInstance->VoiceCenterChannelVolume = 0.f;
WaveInstance->RadioFilterVolume = 0.f;
WaveInstance->RadioFilterVolumeThreshold = 0.f;
WaveInstance->StereoBleed = 0.f;
WaveInstance->LFEBleed = 0.f;
WaveInstance->bEQFilterApplied = ActiveSound.bEQFilterApplied;
WaveInstance->bIsUISound = ActiveSound.bIsUISound;
WaveInstance->bIsMusic = ActiveSound.bIsMusic;
WaveInstance->bReverb = ActiveSound.bReverb;
WaveInstance->bCenterChannelOnly = ActiveSound.bCenterChannelOnly;
bAlwaysPlay = ActiveSound.bAlwaysPlay;
}
WaveInstance->PlayPriority = WaveInstance->Volume + ( bAlwaysPlay ? 1.0f : 0.0f ) + WaveInstance->RadioFilterVolume;
WaveInstance->Location = ParseParams.Transform.GetTranslation();
WaveInstance->bIsStarted = true;
WaveInstance->bAlreadyNotifiedHook = false;
WaveInstance->bUseSpatialization = ParseParams.bUseSpatialization;
WaveInstance->WaveData = this;
WaveInstance->NotifyBufferFinishedHooks = ParseParams.NotifyBufferFinishedHooks;
WaveInstance->LoopingMode = ((bLooping || ParseParams.bLooping) ? LOOP_Forever : LOOP_Never);
// Don't add wave instances that are not going to be played at this point.
if( WaveInstance->PlayPriority > KINDA_SMALL_NUMBER )
{
WaveInstances.Add( WaveInstance );
}
//.........这里部分代码省略.........
示例2: Parse
void USoundWave::Parse( FAudioDevice* AudioDevice, const UPTRINT NodeWaveInstanceHash, FActiveSound& ActiveSound, const FSoundParseParameters& ParseParams, TArray<FWaveInstance*>& WaveInstances )
{
FWaveInstance* WaveInstance = ActiveSound.FindWaveInstance(NodeWaveInstanceHash);
// Create a new WaveInstance if this SoundWave doesn't already have one associated with it.
if( WaveInstance == NULL )
{
if( !ActiveSound.bRadioFilterSelected )
{
ActiveSound.ApplyRadioFilter(ParseParams);
}
WaveInstance = HandleStart( ActiveSound, NodeWaveInstanceHash);
}
// Looping sounds are never actually finished
if (bLooping || ParseParams.bLooping)
{
WaveInstance->bIsFinished = false;
#if !(NO_LOGGING || UE_BUILD_SHIPPING || UE_BUILD_TEST)
if (!ActiveSound.bWarnedAboutOrphanedLooping && ActiveSound.GetAudioComponentID() == 0)
{
UE_LOG(LogAudio, Warning, TEXT("Detected orphaned looping sound '%s'."), *ActiveSound.GetSound()->GetName());
ActiveSound.bWarnedAboutOrphanedLooping = true;
}
#endif
}
// Check for finished paths.
if( !WaveInstance->bIsFinished )
{
// Propagate properties and add WaveInstance to outgoing array of FWaveInstances.
WaveInstance->Volume = ParseParams.Volume * Volume;
WaveInstance->VolumeMultiplier = ParseParams.VolumeMultiplier;
WaveInstance->VolumeApp = ParseParams.VolumeApp;
WaveInstance->Pitch = ParseParams.Pitch * Pitch;
WaveInstance->bEnableLowPassFilter = ParseParams.bEnableLowPassFilter;
WaveInstance->bIsOccluded = ParseParams.bIsOccluded;
WaveInstance->LowPassFilterFrequency = ParseParams.LowPassFilterFrequency;
WaveInstance->OcclusionFilterFrequency = ParseParams.OcclusionFilterFrequency;
WaveInstance->AttenuationFilterFrequency = ParseParams.AttenuationFilterFrequency;
WaveInstance->AmbientZoneFilterFrequency = ParseParams.AmbientZoneFilterFrequency;
WaveInstance->bApplyRadioFilter = ActiveSound.bApplyRadioFilter;
WaveInstance->StartTime = ParseParams.StartTime;
WaveInstance->UserIndex = ActiveSound.UserIndex;
WaveInstance->OmniRadius = ParseParams.OmniRadius;
WaveInstance->StereoSpread = ParseParams.StereoSpread;
WaveInstance->AttenuationDistance = ParseParams.AttenuationDistance;
WaveInstance->AbsoluteAzimuth = ParseParams.AbsoluteAzimuth;
bool bAlwaysPlay = false;
// Properties from the sound class
WaveInstance->SoundClass = ParseParams.SoundClass;
if (ParseParams.SoundClass)
{
FSoundClassProperties* SoundClassProperties = AudioDevice->GetSoundClassCurrentProperties(ParseParams.SoundClass);
// Use values from "parsed/ propagated" sound class properties
WaveInstance->VolumeMultiplier *= SoundClassProperties->Volume;
WaveInstance->Pitch *= SoundClassProperties->Pitch;
//TODO: Add in HighFrequencyGainMultiplier property to sound classes
WaveInstance->VoiceCenterChannelVolume = SoundClassProperties->VoiceCenterChannelVolume;
WaveInstance->RadioFilterVolume = SoundClassProperties->RadioFilterVolume * ParseParams.VolumeMultiplier;
WaveInstance->RadioFilterVolumeThreshold = SoundClassProperties->RadioFilterVolumeThreshold * ParseParams.VolumeMultiplier;
WaveInstance->StereoBleed = SoundClassProperties->StereoBleed;
WaveInstance->LFEBleed = SoundClassProperties->LFEBleed;
WaveInstance->bIsUISound = ActiveSound.bIsUISound || SoundClassProperties->bIsUISound;
WaveInstance->bIsMusic = ActiveSound.bIsMusic || SoundClassProperties->bIsMusic;
WaveInstance->bCenterChannelOnly = ActiveSound.bCenterChannelOnly || SoundClassProperties->bCenterChannelOnly;
WaveInstance->bEQFilterApplied = ActiveSound.bEQFilterApplied || SoundClassProperties->bApplyEffects;
WaveInstance->bReverb = ActiveSound.bReverb || SoundClassProperties->bReverb;
WaveInstance->OutputTarget = SoundClassProperties->OutputTarget;
if (SoundClassProperties->bApplyAmbientVolumes)
{
WaveInstance->VolumeMultiplier *= ParseParams.InteriorVolumeMultiplier;
WaveInstance->RadioFilterVolume *= ParseParams.InteriorVolumeMultiplier;
WaveInstance->RadioFilterVolumeThreshold *= ParseParams.InteriorVolumeMultiplier;
}
bAlwaysPlay = ActiveSound.bAlwaysPlay || SoundClassProperties->bAlwaysPlay;
}
else
{
WaveInstance->VoiceCenterChannelVolume = 0.f;
WaveInstance->RadioFilterVolume = 0.f;
WaveInstance->RadioFilterVolumeThreshold = 0.f;
WaveInstance->StereoBleed = 0.f;
WaveInstance->LFEBleed = 0.f;
WaveInstance->bEQFilterApplied = ActiveSound.bEQFilterApplied;
WaveInstance->bIsUISound = ActiveSound.bIsUISound;
WaveInstance->bIsMusic = ActiveSound.bIsMusic;
WaveInstance->bReverb = ActiveSound.bReverb;
WaveInstance->bCenterChannelOnly = ActiveSound.bCenterChannelOnly;
bAlwaysPlay = ActiveSound.bAlwaysPlay;
}
//.........这里部分代码省略.........