You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Removing need for alignment in audio DSP. - Decreased header dependencies across codebase to improve build times - Fixed improper `using namespace` issues. #jira UE-147590 #rb Helen.Yang, Alfaroh.Corneyiii #preflight 62a789bd2c521c9c6dac7bb6 [CL 20648535 by phil popp in ue5-main branch]
34 lines
839 B
C++
34 lines
839 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "DSP/AudioDebuggingUtilities.h"
|
|
|
|
#include "DSP/Dsp.h"
|
|
#include "DSP/FloatArrayMath.h"
|
|
#include "HAL/Platform.h"
|
|
|
|
void BreakWhenAudible(float* InBuffer, int32 NumSamples)
|
|
{
|
|
static const float AudibilityThreshold = Audio::ConvertToLinear(-40.0f);
|
|
|
|
TArrayView<const float> InBufferView(InBuffer, NumSamples);
|
|
float BufferAmplitude = Audio::ArrayGetAverageAbsValue(InBufferView);
|
|
|
|
if (BufferAmplitude > AudibilityThreshold)
|
|
{
|
|
PLATFORM_BREAK();
|
|
}
|
|
}
|
|
|
|
void BreakWhenTooLoud(float* InBuffer, int32 NumSamples)
|
|
{
|
|
static const float PainThreshold = Audio::ConvertToLinear(3.0f);
|
|
|
|
TArrayView<const float> InBufferView(InBuffer, NumSamples);
|
|
float BufferAmplitude = Audio::ArrayGetAverageAbsValue(InBufferView);
|
|
|
|
if (BufferAmplitude > PainThreshold)
|
|
{
|
|
PLATFORM_BREAK();
|
|
}
|
|
}
|