21 return mImpl->pcm().size();
39 if (
mImpl ==
nullptr || other.
mImpl ==
nullptr) {
42 if (
mImpl->pcm().size() != other.
mImpl->pcm().size()) {
45 for (
size_t i = 0; i <
mImpl->pcm().
size(); ++i) {
46 if (
mImpl->pcm()[i] != other.
mImpl->pcm()[i]) {
54 return !(*
this == other);
58 static int16_t empty_data[1] = {0};
71 for (
int i = 0; i < N; ++i) {
72 int32_t x32 = int32_t(
pcm()[i]);
75 float rms = sqrtf(
float(sum_sq) / N);
87 for (
size_t i = 0; i < count; ++i) {
88 double s = samples[i] / 32768.0;
91 double p = sum_sq / count;
92 double dbfs = 10.0 * log10(
p + 1e-12);
fl::vector< int16_t > VectorPCM
const VectorPCM & pcm() const
const int16_t & at(size_t i) const
bool operator!=(const AudioSample &other) const
bool operator==(const AudioSample &other) const
const int16_t & operator[](size_t i) const
AudioSample & operator=(const AudioSample &other)
static const VectorPCM & empty()
double dbfs_floor_global_
void processBlock(const int16_t *samples, size_t count)
Process a block of int16 PCM samples.
SoundLevelMeter(double spl_floor=33.0f, double smoothing_alpha=0.0)
Implements a simple red square effect for 2D LED grids.
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
static int DefaultSampleRate()
static float DefaultMinFrequency()
static float DefaultMaxFrequency()