3

I'm trying to convert an audio file to an FFMPEG waveform, train it in HyperGAN, and produce an image file to convert to an audio file. What I'm asking is if there is a way to convert a waveform image back to an audio file without any loss of quality (basically, if you were to hash the original and the converted one, it would be the same hash), and if FFMPEG is the correct tool to use. Currently I have a batch script to go through all my audio files and convert them to images (ffmpeg.exe -i %1 -lavfi showwavespic=s=1024x800:colors=0971CE %1.png), but I can't convert them back to audio files, which defeats the purpose of what I'm doing.

EDIT: FFMPEG converts a 5mb audio file to a 32kb image, so I don't think it would convert back. Is there anyway to make it more detailed?

1

FFmpeg can't do this.

Even theoretically, the method seems unsound (no pun intended). Audios are typically sampled at 40K+ Hz per second. Max image dimension in ffmpeg is 65K. So even at that size, one can barely represent 1.5 seconds of audio at full sampling resolution. Once you go lower and rely on interpolation, your output quality will start to degrade, as your reconstruction gets coarser.

  • Thanks for the answer, but do you (or anyone else) know of a program that could do this? – PintsizedSix40 Feb 9 '18 at 6:28
  • Sounds like Photosounder may be able to do this. – Gyan Feb 9 '18 at 7:48
  • Photosounder might work, though it isn't free and you cant automate it. – PintsizedSix40 Feb 10 '18 at 19:44
0

See spectrumsynth filter documentation. You will need to use showspectrum filter instead. And to have also phase video. Using only showspectrumpic is not doable as it shrinks time resolution drastically.

  • I think the OP wants to externally manipulate a time-domain amplitude graph and reconvert it back to audio. – Gyan Feb 10 '18 at 10:57
  • Ah, that one, yes you are correct. That one is not even possible, you loose resolution in both ways: time and amplitude domain. – Paul B. Mahol Feb 10 '18 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.