calculate Hertz frequency from audio buffer