'Spectrogram image to Audio

I want to write a python script which takes the input as the image of the spectrogram and generates the audio from it. Is there a way to convert the image of spectrogram into corresponding audio ? I believe that there must be a way to reverse engineer the image of spectrogram to generate the audio. Can someone please help me with the same?



Solution 1:[1]

By a strange coincidence, I also needed to do this to recover audio for which only the spectrograms were available, but could find no tools to do this so wrote it myself in C. It's not simple and the results are, as user14325 rightly points out, very noisy compared to the originals, partly due to the low time resolution of most spectrograms but mostly because the phase information for each data point is lost and has to be invented.

However, if you are interested, you will find a brief description at https://wikidelia.net/wiki/Spectrograms#Inverse_spectrograms and you can find the code by following the "even hairier custom software" link and checking the files named "run.*" (the rest of the code there is for log-freq-axis forward spectrograms)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 martinwguy