Improve the speed of the pack_pcm_data function
Improve the speed of the pack_pcm_data function

pack_pcm_data function has some heavy logic for packing a wave generator
into a bytearray, which unfortunately can have a serious performance hit
when trying to generate, for instance, wav files bigger than a given threshold.
Instead of generating beforehand a potential huge list of wave forms, the patch
uses itertools.islice for first getting all the required wave forms, then multiples
the results with the amplitude scale. By using some local CPython speeding tricks,
the function can get a close to 50% speed up.

benmoran56/chippy