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
HephAudio::EncodedAudioBuffer Class Reference

stores encoded audio data. More...

#include <EncodedAudioBuffer.h>

Inheritance diagram for HephAudio::EncodedAudioBuffer:
Heph::BufferBase< EncodedAudioBuffer, uint8_t > HephAudio::FFmpegEncodedAudioBuffer

Public Member Functions

 EncodedAudioBuffer ()
 
 EncodedAudioBuffer (const AudioFormatInfo &formatInfo)
 
 EncodedAudioBuffer (size_t size, const AudioFormatInfo &formatInfo)
 
 EncodedAudioBuffer (const uint8_t *pData, size_t size, const AudioFormatInfo &formatInfo)
 
 EncodedAudioBuffer (const EncodedAudioBuffer &)=delete
 
 EncodedAudioBuffer (EncodedAudioBuffer &&rhs) noexcept
 
virtual ~EncodedAudioBuffer ()=default
 
EncodedAudioBufferoperator= (const EncodedAudioBuffer &)=delete
 
EncodedAudioBufferoperator= (EncodedAudioBuffer &&rhs) noexcept
 
virtual void Release () override
 
const AudioFormatInfoGetAudioFormatInfo () const
 
void SetAudioFormatInfo (const AudioFormatInfo &newFormatInfo)
 
void Add (const uint8_t *pData, size_t size)
 

Protected Attributes

AudioFormatInfo formatInfo
 
- Protected Attributes inherited from Heph::BufferBase< EncodedAudioBuffer, uint8_t >
uint8_t * pData
 
size_t size
 

Friends

class Heph::BufferBase< EncodedAudioBuffer, uint8_t >
 

Additional Inherited Members

- Protected Member Functions inherited from Heph::BufferBase< EncodedAudioBuffer, uint8_t >
 BufferBase ()
 
 BufferBase (size_t size)
 
 BufferBase (size_t size, BufferFlags flags)
 
 BufferBase (const std::initializer_list< uint8_t > &rhs)
 
 BufferBase (const BufferBase &rhs)
 
 BufferBase (BufferBase &&rhs) noexcept
 
EncodedAudioBuffer & operator= (const std::initializer_list< uint8_t > &rhs)
 
EncodedAudioBuffer & operator= (const EncodedAudioBuffer &rhs)
 
EncodedAudioBuffer & operator= (EncodedAudioBuffer &&rhs) noexcept
 
virtual ~BufferBase ()
 
virtual EncodedAudioBuffer operator<< (size_t rhs) const
 
virtual EncodedAudioBuffer & operator<<= (size_t rhs)
 
virtual EncodedAudioBuffer operator>> (size_t rhs) const
 
virtual EncodedAudioBuffer & operator>>= (size_t rhs)
 
virtual bool operator== (const EncodedAudioBuffer &rhs) const
 
virtual bool operator!= (const EncodedAudioBuffer &rhs) const
 
uint8_t & operator[] (size_t index) const
 
size_t Size () const
 
size_t SizeAsByte () const
 
uint8_t & At (size_t index) const
 
virtual bool IsEmpty () const
 
virtual void Reset ()
 
virtual EncodedAudioBuffer SubBuffer (size_t index, size_t size) const
 
virtual void Prepend (const EncodedAudioBuffer &rhs)
 
virtual void Append (const EncodedAudioBuffer &rhs)
 
virtual void Insert (const EncodedAudioBuffer &rhs, size_t index)
 
virtual void Cut (size_t index, size_t size)
 
virtual void Replace (const EncodedAudioBuffer &rhs, size_t index)
 
virtual void Replace (const EncodedAudioBuffer &rhs, size_t index, size_t size)
 
virtual void Resize (size_t newSize)
 
virtual void Reverse ()
 
uint8_t * begin () const
 
uint8_t * end () const
 
- Static Protected Member Functions inherited from Heph::BufferBase< EncodedAudioBuffer, uint8_t >
static size_t SizeAsByte (size_t size)
 
static uint8_t * SubBuffer (uint8_t *pThisData, size_t thisSize_byte, size_t index_byte, size_t subBufferSize_byte)
 
static uint8_t * Prepend (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte)
 
static uint8_t * Append (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte)
 
static uint8_t * Insert (uint8_t *pThisData, size_t thisSize_byte, uint8_t *pRhsData, size_t rhsSize_byte, size_t index_byte)
 
static uint8_t * Cut (uint8_t *pThisData, size_t thisSize_byte, size_t index_byte, size_t &cutSize_byte)
 
static void Replace (uint8_t *pThisData, size_t thisSize_byte, uint8_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 uint8_t * Allocate (size_t size_byte)
 
static uint8_t * AllocateUninitialized (size_t size_byte)
 

Detailed Description

stores encoded audio data.

Constructor & Destructor Documentation

◆ EncodedAudioBuffer() [1/6]

HephAudio::EncodedAudioBuffer::EncodedAudioBuffer ( )

creates a new instance and initializes it with default values.

◆ EncodedAudioBuffer() [2/6]

HephAudio::EncodedAudioBuffer::EncodedAudioBuffer ( const AudioFormatInfo & formatInfo)
explicit

creates a new instance and initializes it with the provided values.

Parameters
formatInfoaudio format info of the encoded data.

◆ EncodedAudioBuffer() [3/6]

HephAudio::EncodedAudioBuffer::EncodedAudioBuffer ( size_t size,
const AudioFormatInfo & formatInfo )

creates a new instance and initializes it with the provided values.

Parameters
sizenumber of bytes the buffer will store.
formatInfoaudio format info of the encoded data.

◆ EncodedAudioBuffer() [4/6]

HephAudio::EncodedAudioBuffer::EncodedAudioBuffer ( const uint8_t * pData,
size_t size,
const AudioFormatInfo & formatInfo )

creates a new instance and initializes it with the provided values.

Parameters
pDatapointer to the data that the buffer will store (copies the data).
sizenumber of bytes the buffer will store.
formatInfoaudio format info of the encoded data.

◆ EncodedAudioBuffer() [5/6]

HephAudio::EncodedAudioBuffer::EncodedAudioBuffer ( const EncodedAudioBuffer & )
delete

creates a new instance and copies the rhs's data to it.

Parameters
rhsinstance whose data will be copied.

◆ EncodedAudioBuffer() [6/6]

HephAudio::EncodedAudioBuffer::EncodedAudioBuffer ( EncodedAudioBuffer && rhs)
noexcept

creates a new instance and moves the rhs's data to it.

Parameters
rhsinstance whose data will be moved.

◆ ~EncodedAudioBuffer()

virtual HephAudio::EncodedAudioBuffer::~EncodedAudioBuffer ( )
virtualdefault

releases the resources and destroys the instance.

Member Function Documentation

◆ Release()

virtual void HephAudio::EncodedAudioBuffer::Release ( )
overridevirtual

releases the resources.

Reimplemented from Heph::BufferBase< EncodedAudioBuffer, uint8_t >.

Reimplemented in HephAudio::FFmpegEncodedAudioBuffer.

◆ GetAudioFormatInfo()

const AudioFormatInfo & HephAudio::EncodedAudioBuffer::GetAudioFormatInfo ( ) const

gets the AudioFormatInfo of the buffer.

◆ SetAudioFormatInfo()

void HephAudio::EncodedAudioBuffer::SetAudioFormatInfo ( const AudioFormatInfo & newFormatInfo)

sets the AudioFormatInfo of the buffer.

◆ Add()

void HephAudio::EncodedAudioBuffer::Add ( const uint8_t * pData,
size_t size )

adds encoded audio data to the end of the buffer.

Parameters
pDatapointer to the encoded data that will be added.
sizenumber of bytes that will be added.

Member Data Documentation

◆ formatInfo

AudioFormatInfo HephAudio::EncodedAudioBuffer::formatInfo
protected

format of the encoded audio data.