PaulStoffregen / Audio

Teensy Audio Library
http://www.pjrc.com/teensy/td_libs_Audio.html
1.1k stars 404 forks source link

allow compile AUDIO_BLOCK_SAMPLES = 4 or 8 #421

Closed ericfont closed 2 years ago

ericfont commented 2 years ago

I'm just trying to get the audio library to compile when AUDIO_BLOCK_SAMPLES == 4 or AUDIO_BLOCK_SAMPLES == 8, which would produce the compile error:

/home/e/arduino-1.8.16/hardware/teensy/avr/libraries/Audio/effect_freeverb.cpp:122:3: error: too many initializers for 'int16_t [8] {aka short int [8]}'
 } };
   ^
Multiple libraries were found for "SD.h"
 Used: /home/e/arduino-1.8.16/hardware/teensy/avr/libraries/SD
 Not used: /home/e/arduino-1.8.16/libraries/SD
Error compiling for board Teensy 4.1.

I haven't looked closely at this effect, but it seems if the effect just wants a zero block then this would suffice. However, if for what ever reason this effect isn't supposed to work for (AUDIO_BLOCK_SAMPLES < 16), then maybe could just disable this .cpp and .h file.

ericfont commented 2 years ago

(maybe if there are possibly other effects that will want an array of AUDIO_BLOCK_SAMPLES worth of zeroes for whatever reason, then maybe could save space by having those effects include a zeroblock.h which allocates this zeroblock once, and then all those effects could just reference the same zeroblock)