|
| AudioBlockView (std::span< ElementType, Extent > view, const uint_fast32_t numChannels) noexcept |
| Constructor. 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 | setSample (const uint_fast32_t destChannel, const uint_fast32_t destSample, const ElementType newValue) |
| Set a sample in the buffer. More...
|
|
void | addSample (const uint_fast32_t destChannel, const uint_fast32_t destSample, const ElementType valueToAdd) |
| Add a value to a sample in the buffer. More...
|
|
void | clear () |
| Set all samples to 0.
|
|
void | applyGain (const float gain) |
| Applies a gain multiple to all the audio data.
|
|
float | getPeak (const uint_fast32_t channel) const |
| Finds the highest absolute sample value within a region of a channel. More...
|
|
float | getRMSLevel (const uint_fast32_t channel) const |
| Returns the root mean squared level for a region of a channel. More...
|
|
auto | subView (uint_fast32_t offset, uint_fast32_t size) |
| Returns an AudioBlockView that references N elements from an arbitrary position. More...
|
|
template<class ElementType, size_t Extent>
class ame::AudioBlockView< ElementType, Extent >
A lightweight data structure that stores a pointer to an audio buffer.
This class doesn't own any of the data which it points to, it's simply a view into data that is owned elsewhere. You can construct one from some raw data that you've allocated yourself, or give it an AudioBuffer which it can refer to, but in all cases the user is responsible for making sure that the data doesn't get deleted while there's still an AudioBlock using it.
- Attention
- Channel order is interleaved.
- See also
- AudioBuffer