HephAudio v3.1.0
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
AudioEffect.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
3#include "AudioBuffer.h"
4#include <string>
5
8namespace HephAudio
9{
15 {
16 protected:
21
22 protected:
25
26 public:
28 virtual ~AudioEffect() = default;
29
34 virtual std::string Name() const = 0;
35
40 virtual bool HasMTSupport() const;
41
46 virtual bool HasRTSupport() const;
47
52 virtual size_t GetThreadCount() const;
53
59 virtual void SetThreadCount(size_t threadCount);
60
68 virtual size_t CalculateRequiredFrameCount(size_t outputFrameCount, const AudioFormatInfo& formatInfo) const;
69
77 virtual size_t CalculateOutputFrameCount(size_t inputFrameCount, const AudioFormatInfo& formatInfo) const;
78
86 virtual size_t CalculateAdvanceSize(size_t renderFrameCount, const AudioFormatInfo& formatInfo) const;
87
92 virtual void ResetInternalState();
93
100 virtual void Process(AudioBuffer& buffer);
101
109 virtual void Process(AudioBuffer& buffer, size_t startIndex);
110
119 virtual void Process(AudioBuffer& buffer, size_t startIndex, size_t frameCount);
120
121 protected:
131 virtual void ProcessST(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount) = 0;
132
142 virtual void ProcessMT(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount);
143 };
144}
#define HEPH_API
Definition HephShared.h:124
class for storing the audio samples in internal format.
Definition AudioBuffer.h:16
base class for the audio effects.
Definition AudioEffect.h:15
virtual bool HasRTSupport() const
virtual void SetThreadCount(size_t threadCount)
virtual bool HasMTSupport() const
virtual size_t CalculateRequiredFrameCount(size_t outputFrameCount, const AudioFormatInfo &formatInfo) const
virtual void ResetInternalState()
virtual void Process(AudioBuffer &buffer)
virtual void ProcessST(const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount)=0
virtual void ProcessMT(const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount)
size_t threadCount
Definition AudioEffect.h:20
virtual size_t GetThreadCount() const
virtual size_t CalculateOutputFrameCount(size_t inputFrameCount, const AudioFormatInfo &formatInfo) const
virtual std::string Name() const =0
virtual void Process(AudioBuffer &buffer, size_t startIndex, size_t frameCount)
virtual size_t CalculateAdvanceSize(size_t renderFrameCount, const AudioFormatInfo &formatInfo) const
virtual ~AudioEffect()=default
virtual void Process(AudioBuffer &buffer, size_t startIndex)
stores the properties of the audio signals
Definition AudioFormatInfo.h:20