Skip to content

Commit bb718dc

Browse files
committed
Equalizer3Bands: error message for missing begin
1 parent 4ed6381 commit bb718dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AudioTools/CoreAudio/AudioFilter/Equalizer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ class Equalizer3Bands : public ModifyingStream {
161161
} *state = nullptr;
162162

163163
void filterSamples(const uint8_t *data, size_t len) {
164+
if (state == nullptr){
165+
LOGE("You need to call begin() before using the equalizer");
166+
return;
167+
}
164168
switch (p_cfg->bits_per_sample) {
165169
case 16: {
166170
int16_t *p_dataT = (int16_t *)data;

0 commit comments

Comments
 (0)