An audio buffer that supports multiple channels whose size is determined at compile time.
More...
#include <ame_AudioBuffer.hpp>
|
| AudioBuffer (const uint_fast32_t numChannels) |
|
void | setNumChannels (const uint_fast32_t channels) |
| Set the number of channels. More...
|
|
uint_fast32_t | getNumChannels () const noexcept |
| Returns the number of channels.
|
|
uint_fast32_t | getNumSamplesPerChannel () const noexcept |
| Returns the number of samples per channel.
|
|
void | clear () |
| Set all samples to 0.
|
|
void | applyGain (const float gain) |
| Applies a gain multiple to all the audio data.
|
|
auto | makeAudioBlockView (uint_fast32_t offset=0, uint_fast32_t size=Size) |
| Returns an AudioBlockView that references N elements from an arbitrary position. More...
|
|
template<size_t Extent> |
void | addFrom (const uint_fast32_t destChannel, const uint_fast32_t destStartSample, const AudioBlockView< FloatType, Extent > &source, const uint_fast32_t sourceChannel, const uint_fast32_t sourceStartSample, const uint_fast32_t numSamplesToAdd) |
| addBuffer
|
|
FloatType | getPeak (const uint_fast32_t channel) const |
| Finds the highest absolute sample value within a region of a channel. More...
|
|
FloatType | getRMSLevel (const uint_fast32_t channel) const |
| Returns the root mean squared level for a region of a channel. More...
|
|
|
std::array< FloatType, Size > | buffer = {} |
|
template<typename FloatType, size_t Size>
class ame::AudioBuffer< FloatType, Size >
An audio buffer that supports multiple channels whose size is determined at compile time.
- Attention
- Channel order is interleaved.
- Template Parameters
-
SampleType | |
Size | Total length of buffer |
◆ getPeak()
template<typename FloatType , size_t Size>
FloatType ame::AudioBuffer< FloatType, Size >::getPeak |
( |
const uint_fast32_t |
channel | ) |
const |
|
inline |
Finds the highest absolute sample value within a region of a channel.
- Parameters
-
- Returns
- FloatType [0.0, FloatTypeMax]
◆ getRMSLevel()
template<typename FloatType , size_t Size>
FloatType ame::AudioBuffer< FloatType, Size >::getRMSLevel |
( |
const uint_fast32_t |
channel | ) |
const |
|
inline |
Returns the root mean squared level for a region of a channel.
- Parameters
-
- Returns
- FloatType RMS level [0.0, FloatTypeMax]
◆ makeAudioBlockView()
template<typename FloatType , size_t Size>
auto ame::AudioBuffer< FloatType, Size >::makeAudioBlockView |
( |
uint_fast32_t |
offset = 0 , |
|
|
uint_fast32_t |
size = Size |
|
) |
| |
|
inline |
Returns an AudioBlockView that references N elements from an arbitrary position.
- Parameters
-
offset | Start location |
size | Number of elements |
- Returns
- ame::AudioBlockView
- See also
- std::span::subspan()
-
ame::AudioBlockView::subView()
- Attention
- Be careful that size is NOT the number of samples per channel, but the size of std::span.
◆ setNumChannels()
template<typename FloatType , size_t Size>
void ame::AudioBuffer< FloatType, Size >::setNumChannels |
( |
const uint_fast32_t |
channels | ) |
|
|
inline |
Set the number of channels.
Update numSamples (number of samples per channel) based on the buffer length.
- Parameters
-
channels | number of channels |
The documentation for this class was generated from the following file: