changed the code to allow variable sized arrays
merging the bug-removed audio processing code