HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
class for storing the audio samples in internal format. More...
#include <AudioBuffer.h>
Public Member Functions | |
AudioBuffer () | |
AudioBuffer (size_t frameCount, const AudioChannelLayout &channelLayout, uint32_t sampleRate) | |
AudioBuffer (size_t frameCount, const AudioChannelLayout &channelLayout, uint32_t sampleRate, Heph::BufferFlags flags) | |
AudioBuffer (const AudioBuffer &rhs) | |
AudioBuffer (AudioBuffer &&rhs) noexcept | |
~AudioBuffer () | |
AudioBuffer & | operator= (const AudioBuffer &rhs) |
AudioBuffer & | operator= (AudioBuffer &&rhs) noexcept |
AudioBuffer | operator<< (size_t rhs) const override |
AudioBuffer & | operator<<= (size_t rhs) override |
AudioBuffer | operator>> (size_t rhs) const override |
AudioBuffer & | operator>>= (size_t rhs) override |
bool | operator== (const AudioBuffer &rhs) const override |
heph_audio_sample_t * | operator[] (size_t frameIndex) const |
void | Release () override |
AudioBuffer | SubBuffer (size_t frameIndex, size_t frameCount) const override |
void | Prepend (const AudioBuffer &rhs) override |
void | Append (const AudioBuffer &rhs) override |
void | Insert (const AudioBuffer &rhs, size_t frameIndex) override |
void | Cut (size_t frameIndex, size_t frameCount) override |
void | Replace (const AudioBuffer &rhs, size_t frameIndex, size_t frameCount) override |
void | Resize (size_t newFrameCount) override |
void | Reverse () override |
size_t | FrameCount () const |
const AudioFormatInfo & | FormatInfo () const |
void | SetChannelLayout (const AudioChannelLayout &channelLayout) |
void | SetSampleRate (uint32_t sampleRate) |
Public Member Functions inherited from Heph::SignedArithmeticBuffer< AudioBuffer, heph_audio_sample_t > | |
virtual | ~SignedArithmeticBuffer ()=default |
void | Invert () |
heph_audio_sample_t | AbsMax () const |
Public Member Functions inherited from Heph::ArithmeticBuffer< AudioBuffer, heph_audio_sample_t > | |
virtual | ~ArithmeticBuffer ()=default |
heph_audio_sample_t | Min () const |
heph_audio_sample_t | Max () const |
double | Rms () const |
Public Member Functions inherited from Heph::BufferBase< AudioBuffer, heph_audio_sample_t > | |
virtual | ~BufferBase () |
virtual bool | operator== (const AudioBuffer &rhs) const |
virtual bool | operator!= (const AudioBuffer &rhs) const |
heph_audio_sample_t & | operator[] (size_t index) const |
size_t | Size () const |
size_t | SizeAsByte () const |
heph_audio_sample_t & | At (size_t index) const |
virtual bool | IsEmpty () const |
virtual void | Reset () |
virtual void | Prepend (const AudioBuffer &rhs) |
virtual void | Append (const AudioBuffer &rhs) |
virtual void | Insert (const AudioBuffer &rhs, size_t index) |
virtual void | Replace (const AudioBuffer &rhs, size_t index) |
virtual void | Replace (const AudioBuffer &rhs, size_t index, size_t size) |
heph_audio_sample_t * | begin () const |
heph_audio_sample_t * | end () const |
Public Member Functions inherited from Heph::BufferArithmeticOperators< AudioBuffer, heph_audio_sample_t > | |
BufferArithmeticOperators (const BufferArithmeticOperators &)=delete | |
BufferArithmeticOperators & | operator= (const BufferArithmeticOperators &)=delete |
Public Member Functions inherited from Heph::BufferAdditionOperator< AudioBuffer, heph_audio_sample_t, heph_audio_sample_t, heph_audio_sample_t > | |
BufferAdditionOperator (const BufferAdditionOperator &)=delete | |
BufferAdditionOperator & | operator= (const BufferAdditionOperator &)=delete |
Public Member Functions inherited from Heph::BufferSubtractionOperator< AudioBuffer, heph_audio_sample_t, heph_audio_sample_t, heph_audio_sample_t > | |
BufferSubtractionOperator (const BufferSubtractionOperator &)=delete | |
BufferSubtractionOperator & | operator= (const BufferSubtractionOperator &)=delete |
Public Member Functions inherited from Heph::BufferMultiplicationOperator< AudioBuffer, heph_audio_sample_t, heph_audio_sample_t, heph_audio_sample_t > | |
BufferMultiplicationOperator (const BufferMultiplicationOperator &)=delete | |
BufferMultiplicationOperator & | operator= (const BufferMultiplicationOperator &)=delete |
Public Member Functions inherited from Heph::BufferDivisionOperator< AudioBuffer, heph_audio_sample_t, heph_audio_sample_t, heph_audio_sample_t > | |
BufferDivisionOperator (const BufferDivisionOperator &)=delete | |
BufferDivisionOperator & | operator= (const BufferDivisionOperator &)=delete |
Public Member Functions inherited from Heph::BufferArithmeticOperators< AudioBuffer, heph_audio_sample_t, AudioBuffer, heph_audio_sample_t > | |
BufferArithmeticOperators (const BufferArithmeticOperators &)=delete | |
BufferArithmeticOperators & | operator= (const BufferArithmeticOperators &)=delete |
Public Member Functions inherited from Heph::BufferAdditionOperator< AudioBuffer, heph_audio_sample_t, AudioBuffer, heph_audio_sample_t > | |
BufferAdditionOperator (const BufferAdditionOperator &)=delete | |
BufferAdditionOperator & | operator= (const BufferAdditionOperator &)=delete |
Public Member Functions inherited from Heph::BufferSubtractionOperator< AudioBuffer, heph_audio_sample_t, AudioBuffer, heph_audio_sample_t > | |
BufferSubtractionOperator (const BufferSubtractionOperator &)=delete | |
BufferSubtractionOperator & | operator= (const BufferSubtractionOperator &)=delete |
Public Member Functions inherited from Heph::BufferMultiplicationOperator< AudioBuffer, heph_audio_sample_t, AudioBuffer, heph_audio_sample_t > | |
BufferMultiplicationOperator (const BufferMultiplicationOperator &)=delete | |
BufferMultiplicationOperator & | operator= (const BufferMultiplicationOperator &)=delete |
Public Member Functions inherited from Heph::BufferDivisionOperator< AudioBuffer, heph_audio_sample_t, AudioBuffer, heph_audio_sample_t > | |
BufferDivisionOperator (const BufferDivisionOperator &)=delete | |
BufferDivisionOperator & | operator= (const BufferDivisionOperator &)=delete |
Public Member Functions inherited from Heph::BufferUnaryMinusOperator< AudioBuffer, heph_audio_sample_t > | |
BufferUnaryMinusOperator (const BufferUnaryMinusOperator &)=delete | |
BufferUnaryMinusOperator & | operator= (const BufferUnaryMinusOperator &)=delete |
Friends | |
class | AudioProcessor |
Additional Inherited Members | |
Protected Member Functions inherited from Heph::SignedArithmeticBuffer< AudioBuffer, heph_audio_sample_t > | |
SignedArithmeticBuffer () | |
SignedArithmeticBuffer (size_t size) | |
SignedArithmeticBuffer (size_t size, BufferFlags flags) | |
SignedArithmeticBuffer (const std::initializer_list< heph_audio_sample_t > &rhs) | |
SignedArithmeticBuffer (const SignedArithmeticBuffer &rhs) | |
SignedArithmeticBuffer (SignedArithmeticBuffer &&rhs) noexcept | |
Protected Member Functions inherited from Heph::ArithmeticBuffer< AudioBuffer, heph_audio_sample_t > | |
ArithmeticBuffer () | |
ArithmeticBuffer (size_t size) | |
ArithmeticBuffer (size_t size, BufferFlags flags) | |
ArithmeticBuffer (const std::initializer_list< heph_audio_sample_t > &rhs) | |
ArithmeticBuffer (const ArithmeticBuffer &rhs) | |
ArithmeticBuffer (ArithmeticBuffer &&rhs) noexcept | |
Protected Member Functions inherited from Heph::BufferBase< AudioBuffer, heph_audio_sample_t > | |
BufferBase () | |
BufferBase (size_t size) | |
BufferBase (size_t size, BufferFlags flags) | |
BufferBase (const std::initializer_list< heph_audio_sample_t > &rhs) | |
BufferBase (const BufferBase &rhs) | |
BufferBase (BufferBase &&rhs) noexcept | |
AudioBuffer & | operator= (const std::initializer_list< heph_audio_sample_t > &rhs) |
AudioBuffer & | operator= (const AudioBuffer &rhs) |
AudioBuffer & | operator= (AudioBuffer &&rhs) noexcept |
Static Protected Member Functions inherited from Heph::BufferBase< AudioBuffer, heph_audio_sample_t > | |
static size_t | SizeAsByte (size_t size) |
static heph_audio_sample_t * | SubBuffer (heph_audio_sample_t *pThisData, size_t thisSize_byte, size_t index_byte, size_t subBufferSize_byte) |
static heph_audio_sample_t * | Prepend (heph_audio_sample_t *pThisData, size_t thisSize_byte, heph_audio_sample_t *pRhsData, size_t rhsSize_byte) |
static heph_audio_sample_t * | Append (heph_audio_sample_t *pThisData, size_t thisSize_byte, heph_audio_sample_t *pRhsData, size_t rhsSize_byte) |
static heph_audio_sample_t * | Insert (heph_audio_sample_t *pThisData, size_t thisSize_byte, heph_audio_sample_t *pRhsData, size_t rhsSize_byte, size_t index_byte) |
static heph_audio_sample_t * | Cut (heph_audio_sample_t *pThisData, size_t thisSize_byte, size_t index_byte, size_t &cutSize_byte) |
static void | Replace (heph_audio_sample_t *pThisData, size_t thisSize_byte, heph_audio_sample_t *pRhsData, size_t rhsSize_byte, size_t index_byte) |
static std::enable_if< std::is_class< U >::value >::type | Initialize (U *pData, U *pDataEnd) |
static std::enable_if<!std::is_class< U >::value >::type | Initialize (U *pData, U *pDataEnd) |
static heph_audio_sample_t * | Allocate (size_t size_byte) |
static heph_audio_sample_t * | AllocateUninitialized (size_t size_byte) |
Protected Attributes inherited from Heph::BufferBase< AudioBuffer, heph_audio_sample_t > | |
heph_audio_sample_t * | pData |
size_t | size |
Static Protected Attributes inherited from Heph::ArithmeticBuffer< AudioBuffer, heph_audio_sample_t > | |
static constexpr heph_audio_sample_t | MIN_ELEMENT |
static constexpr heph_audio_sample_t | MAX_ELEMENT |
class for storing the audio samples in internal format.
HephAudio::AudioBuffer::AudioBuffer | ( | ) |
creates a new instance and initializes it with default values.
HephAudio::AudioBuffer::AudioBuffer | ( | size_t | frameCount, |
const AudioChannelLayout & | channelLayout, | ||
uint32_t | sampleRate ) |
creates a new instance and initializes it with the provided values.
frameCount | number of frames the buffer stores. |
channelLayout | channel layout of the buffer. |
sampleRate | sample rate of the buffer. |
HephAudio::AudioBuffer::AudioBuffer | ( | size_t | frameCount, |
const AudioChannelLayout & | channelLayout, | ||
uint32_t | sampleRate, | ||
Heph::BufferFlags | flags ) |
creates a new instance and initializes it with the provided values.
frameCount | number of frames the buffer stores. |
channelLayout | channel layout of the buffer. |
sampleRate | sample rate of the buffer. |
flags | flags. |
HephAudio::AudioBuffer::AudioBuffer | ( | const AudioBuffer & | rhs | ) |
creates a new instance and copies the rhs's data to it.
rhs | instance whose data will be copied. |
|
noexcept |
creates a new instance and moves the rhs's data to it.
rhs | instance whose data will be moved. |
HephAudio::AudioBuffer::~AudioBuffer | ( | ) |
releases the resources and destroys the instance.
|
overridevirtual |
creates a copy of the current buffer that is shifted to the left.
rhs | number of elements to shift. |
InsufficientMemoryException |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
shifts the current buffer to the left.
rhs | number of elements to shift. |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
creates a copy of the current buffer that is shifted to the right.
rhs | number of elements to shift. |
InsufficientMemoryException |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
shifts the current buffer to the right.
rhs | number of elements to shift. |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
heph_audio_sample_t * HephAudio::AudioBuffer::operator[] | ( | size_t | frameIndex | ) | const |
gets the pointer to the first sample of the audio frame at the provided index.
|
overridevirtual |
releases the resources.
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
gets the desired part of the buffer as a new instance.
index | index of the first element of the sub buffer. |
size | number of elements the sub buffer will store. |
InvalidArgumentException | |
InsufficientMemoryException |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
removes the desired portion of the buffer.
index | index of the first element that will be removed. |
size | number of elements to remove. |
InvalidArgumentException |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
changes the size of the buffer.
if new size is less than the old, excess elements from the end will be removed.
InsufficientMemoryException |
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
|
overridevirtual |
reverses the buffer (first element to last and vice versa).
Reimplemented from Heph::BufferBase< AudioBuffer, heph_audio_sample_t >.
size_t HephAudio::AudioBuffer::FrameCount | ( | ) | const |
gets the number of audio frames the buffer stores.
const AudioFormatInfo & HephAudio::AudioBuffer::FormatInfo | ( | ) | const |
gets the AudioFormatInfo of the buffer.
void HephAudio::AudioBuffer::SetChannelLayout | ( | const AudioChannelLayout & | channelLayout | ) |
changes the channel layout of the buffer.
void HephAudio::AudioBuffer::SetSampleRate | ( | uint32_t | sampleRate | ) |
changes the sample rate of the buffer.