The description of `AACDecode()` function states that the output buffer
must be big enough for 1024 samples per channel _or_ 2048 if SBR is
enabled. By default SBR is enabled on non-ESP8266 platforms, yet the
buffer in `AudioGeneratorAAC` is always 1024 samples per channel long.
This causes memory corruption on ESP32 and possibly Pi Pico. This change
makes the output buffer correct.
Because we are allocating objects totaling over 80% of the ESP8266 memory
space, we are very sensitive to memory fragmentation. While we can control
our own allocs, the IP and SDK can allocate any size, at any time, which
can cause us to not be able to find the large contiguous memory areas we need
for the codes.
Work around this by preallocating, before anything else, buffer memory and
never freeing it. Pass this memory into the codec and it will allocate from
this block and be guaranteed to always succeed.
This may fix the last of the hangs on the webradio/http streaming, which only
seemed to happen after a stop/start cycle.