Now supports different lengths of the .wav file.