Going from audio to waveform image and back to audio

In my last post I showed how I found a great audio to waveform plugin and I also created a .PNG image with the waveform so I could save it.

But what if I wanted to read the waveform and create audio from it, i.e. convert it back.

The sampling frequency / resolution of the waveform plays a important role of course. In my last post the resolution was 100 pixels / second which is way too low (CD quality would be 44100 px/s).

Since it’s Javascript run in the browser it takes some time to generate an waveform image of decent resolution. My MBA seemed to take a resolution of 4000 px/s but not more.

So, I had to go with that.

This is my original recording:

The first step is to create an image so I created a new version of my last post but with 4000 px/s. Here’s the image (9002 x 128 px).


The next step was to find an app that can read this and convert it to audio. This was more difficult that I thought but via mediapreservation.wordpress.com I found a program named ImageToSound.

This was an old app (and for Windows) so I downloaded WinXP from modern.ie and installed it.


ImageToSound takes .bmp-files so I had to convert my .png file. Easy to do in Pixelmator or Photoshop.

to bmp

Time to import the bmp to ImageToSound and see if I got anything.


It’s important to choose 4000 as the sample rate since that’s what I used when I created the pic.

Alright, let’s listen to it.

Pretty far from good quality, but you can hear it’s from the original. There are of course software better suited for the sampling part but it’s fascinating what you can do with Javascript.

Now you can print any sound to paper and save it for the future generations! :)