|
| | AudioBufferView () noexcept=default |
| | Creates an empty view (0 channels, 0 samples).
|
| |
| template<typename U > |
| | AudioBufferView (U *const *channelPtrs, int numChannels, int numSamples) noexcept |
| | Constructs a view from an array of channel pointers safely.
|
| |
| template<typename U > |
| | AudioBufferView (const AudioBufferView< U, MaxViewChannels > &other) noexcept |
| | Converting constructor allowing mutable to const view conversions.
|
| |
| T * | getChannel (int ch) const noexcept |
| | Returns a pointer to the sample data for the given channel.
|
| |
| int | getNumChannels () const noexcept |
| | Returns the number of channels in this view.
|
| |
| int | getNumSamples () const noexcept |
| | Returns the number of samples per channel.
|
| |
| AudioBufferView | getSubView (int startSample, int length) const noexcept |
| | Returns a zero-copy sub-view starting at an offset.
|
| |
| void | clear () const noexcept |
| | Fills the valid sample range of all channels with zeros.
|
| |
| template<typename U , int M> |
| void | copyFrom (const AudioBufferView< U, M > &src) const noexcept |
| | Safely copies samples from a source view into this view.
|
| |
| template<typename U , int M> |
| void | addFrom (const AudioBufferView< U, M > &src, T gain=T(1)) const noexcept |
| | Adds samples from a source view into this view with optional gain.
|
| |
| void | applyGain (T gain) const noexcept |
| | Multiplies all samples in all valid channels by a gain factor.
|
| |
| std::remove_const_t< T > | getPeakLevel () const noexcept |
| | Returns the peak absolute sample value across all channels.
|
| |
template<typename T, int MaxViewChannels = 16>
class dspark::AudioBufferView< T, MaxViewChannels >
Non-owning view over audio channel data.
- Template Parameters
-
| T | Sample type (typically float, double, const float, or const double). |
| MaxViewChannels | Compile-time limit for the internal pointer array. |
Definition at line 49 of file AudioBuffer.h.
template<typename T , int MaxViewChannels = 16>
template<typename U , int M>
Adds samples from a source view into this view with optional gain.
Channel count and length are trimmed to the smaller of the two views. Unlike copyFrom(), the source must NOT overlap this view: the mix goes through restrict-qualified SIMD kernels (see SimdOps.h).
- Template Parameters
-
| U | Source sample type. |
| M | Source view channel capacity (any capacity is accepted). |
- Parameters
-
| src | Source view. |
| gain | Scaling factor. |
Definition at line 197 of file AudioBuffer.h.
template<typename T , int MaxViewChannels = 16>
template<typename U , int M>
Safely copies samples from a source view into this view.
For same-type trivially-copyable samples the copy goes through std::memmove, which is guaranteed safe even when the ranges overlap. Channel count and length are trimmed to the smaller of the two views.
- Template Parameters
-
| U | Source sample type. |
| M | Source view channel capacity (any capacity is accepted). |
- Parameters
-
| src | Source view to copy from. |
Definition at line 160 of file AudioBuffer.h.