Hi Adam,
Here is one way. Create a function to perform the operation on one file
audio[file_] :=
Export[file <> ".wav", #] &@ Audio[InverseSpectrogram[Import[file]], SampleRate -> 8000]
Test it to make sure it works as expected. Note that the output will be written to whatever Directory[]
evaluates to with the same name as the input file with .wav
appended. If you want a different audio format change the file extension in the audio
function.
Assuming all of the input files are in a single directory, and that they are .png
SetDirectory["/path/to/directory"];
files = FileNames["*.png"]
audio /@ files
If you have millions of files it is going to take a while. Use ParallelMap
to speed it up.