Files
UnrealEngineUWP/Engine/Source/Runtime/SignalProcessing/Public/DSP/WaveShaper.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

41 lines
838 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
namespace Audio
{
// A digital wave shaping effect to cause audio distortion
// https://en.wikipedia.org/wiki/Waveshaper
class SIGNALPROCESSING_API FWaveShaper
{
public:
// Constructor
FWaveShaper();
// Destructor
~FWaveShaper();
// Initialize the equalizer
void Init(const float InSampleRate);
// Sets the amount of wave shapping. 0.0 is no effect.
void SetAmount(const float InAmount);
// Sets the output gain of the waveshaper
void SetOutputGainDb(const float InGainDb);
// Processes the audio frame (audio frame must have channels equal to that used during initialization)
void ProcessAudio(const float InSample, float& OutSample);
private:
float Amount;
float AtanAmount;
float OutputGain;
};
}