HephAudio v3.0.6
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
69 virtual size_t CalculateRequiredFrameCount(size_t outputFrameCount, const AudioFormatInfo& formatInfo) const;
70
77 virtual size_t CalculateOutputFrameCount(const AudioBuffer& buffer) const;
78
85 virtual void Process(AudioBuffer& buffer);
86
94 virtual void Process(AudioBuffer& buffer, size_t startIndex);
95
104 virtual void Process(AudioBuffer& buffer, size_t startIndex, size_t frameCount);
105
106 protected:
116 virtual void ProcessST(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount) = 0;
117
127 virtual void ProcessMT(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount);
128 };
129}
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 CalculateOutputFrameCount(const AudioBuffer &buffer) const
virtual size_t CalculateRequiredFrameCount(size_t outputFrameCount, const AudioFormatInfo &formatInfo) const
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 std::string Name() const =0
virtual void Process(AudioBuffer &buffer, size_t startIndex, size_t frameCount)
virtual ~AudioEffect()=default
virtual void Process(AudioBuffer &buffer, size_t startIndex)
stores the properties of the audio signals
Definition AudioFormatInfo.h:20