simplify AudioThread and SpectrogramThread from classes into functions