don't try to generate the buffer outside of the callback
For an unknown reason it is slower...