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
Resampler.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
4
7namespace HephAudio
8{
14 {
15 protected:
21
22 public:
25
32 explicit Resampler(size_t outputSampleRate);
33
35 virtual ~Resampler() = default;
36
37 virtual std::string Name() const override;
38 virtual size_t CalculateRequiredFrameCount(size_t outputFrameCount, const AudioFormatInfo& formatInfo) const override;
39 virtual size_t CalculateOutputFrameCount(size_t inputFrameCount, const AudioFormatInfo& formatInfo) const override;
40 virtual size_t CalculateAdvanceSize(size_t renderFrameCount, const AudioFormatInfo& formatInfo) const override;
41
46 virtual size_t GetOutputSampleRate() const;
47
54 virtual void SetOutputSampleRate(size_t outputSampleRate);
55
56 protected:
57 virtual void ProcessST(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount) override;
58 virtual AudioBuffer CreateOutputBuffer(const AudioBuffer& inputBuffer, size_t startIndex, size_t frameCount) const override;
59 virtual void InitializeOutputBuffer(const AudioBuffer& inputBuffer, AudioBuffer& outputBuffer, size_t startIndex, size_t frameCount) const override;
60 };
61}
#define HEPH_API
Definition HephShared.h:124
class for storing the audio samples in internal format.
Definition AudioBuffer.h:16
base class for audio effects that use a temporary buffer while processing.
Definition DoubleBufferedAudioEffect.h:13
changes the sample rate.
Definition Resampler.h:14
virtual size_t GetOutputSampleRate() const
virtual size_t CalculateRequiredFrameCount(size_t outputFrameCount, const AudioFormatInfo &formatInfo) const override
virtual void ProcessST(const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override
virtual size_t CalculateOutputFrameCount(size_t inputFrameCount, const AudioFormatInfo &formatInfo) const override
virtual std::string Name() const override
Resampler(size_t outputSampleRate)
virtual size_t CalculateAdvanceSize(size_t renderFrameCount, const AudioFormatInfo &formatInfo) const override
virtual AudioBuffer CreateOutputBuffer(const AudioBuffer &inputBuffer, size_t startIndex, size_t frameCount) const override
virtual ~Resampler()=default
size_t outputSampleRate
Definition Resampler.h:20
virtual void SetOutputSampleRate(size_t outputSampleRate)
virtual void InitializeOutputBuffer(const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) const override
stores the properties of the audio signals
Definition AudioFormatInfo.h:20