Open 3D Engine AudioSystem Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Audio::RingBufferBase Class Referenceabstract

Inherited by Audio::RingBuffer< SampleType, typename >.

Public Member Functions

 AZ_CLASS_ALLOCATOR (RingBufferBase, AZ::SystemAllocator)
 
 RingBufferBase (const size_t numSamples)
 
virtual size_t AddData (const void *source, size_t numFrames, size_t numChannels)=0
 
virtual size_t AddMultiTrackDataInterleaved (const void **source, size_t numFrames, size_t numChannels)
 
virtual size_t ConsumeData (void **dest, size_t numFrames, size_t numChannels, bool deinterleaveMultichannel=false)=0
 
virtual void ResetBuffer ()=0
 

Member Function Documentation

◆ AddData()

virtual size_t Audio::RingBufferBase::AddData ( const void *  source,
size_t  numFrames,
size_t  numChannels 
)
pure virtual

Adds new data to the ringbuffer.

Parameters
sourceSource buffer to copy from.
numFramesNumber of sample frames available to copy.
numChannelsNumber of channels in the sample data, samples = numFrames * numChannels.
Returns
Number of sample frames copied.

Implemented in Audio::RingBuffer< SampleType, typename >.

◆ AddMultiTrackDataInterleaved()

virtual size_t Audio::RingBufferBase::AddMultiTrackDataInterleaved ( const void **  source,
size_t  numFrames,
size_t  numChannels 
)
inlinevirtual

Adds new multi-track/multi-channel data to the ringbuffer in interleaved format. Not a required interface.

Parameters
sourceSource buffer to copy from.
numFramesNumber of sample frames available to copy.
numChannelsNumber of tracks/channels in the source data, numSamples = numFrames * numChannels.
Returns
Number of sample frames copied.

Reimplemented in Audio::RingBuffer< SampleType, typename >.

◆ ConsumeData()

virtual size_t Audio::RingBufferBase::ConsumeData ( void **  dest,
size_t  numFrames,
size_t  numChannels,
bool  deinterleaveMultichannel = false 
)
pure virtual

Consumes stored data from the ringbuffer.

Parameters
destWhere the data will be written to, typically an array of SampleType pointers.
numFramesNumber of sample frames requested to consume.
numChannelsNumber of channels laid out in the dest parameter.
deinterleaveMultichannelIn the case of multichannel data, if true do a deinterleaved copy into the dest array channels otherwise straight copy into dest[0].
Returns
Number of sample frames consumed.

Implemented in Audio::RingBuffer< SampleType, typename >.

◆ ResetBuffer()

virtual void Audio::RingBufferBase::ResetBuffer ( )
pure virtual

Zeros the ringbuffer data and resets indices.

Implemented in Audio::RingBuffer< SampleType, typename >.


The documentation for this class was generated from the following file: