Changed writting spectrogram to file.