Reversing a .wav File in C#

David Klempfner
The Startup
Published in
5 min readDec 12, 2019

--

For those of you who don’t know me, I have a unique skill where I can speak backwards phonetically.

Although it’s quite a useless skill, there is a Guinness World Record for it which I’m trying to beat.

To train for this, I needed to make a backwards player app so I could test myself.

Of course there are already many free apps out there, but instead of just downloading one of those, I thought I’d reinvent the wheel, and learn heaps in the process.

The format of a .wav file

According to http://www.topherlee.com/software/pcm-tut-wavformat.html, a .wav file is made up of a header and audio data. The header looks like this:

The header provides metadata to do with the audio file. Some parts of the metadata are essential for us to know if we are to reverse the file.

After the header is the audio data, which is basically the actual values of the audio signal’s amplitudes which make up the sound.

So now we know that a wav file has metadata, and audio data, how do we go about reversing the sound?

What exactly do we need to reverse?

We definitely don’t want to reverse the header, since this contains the metadata to do with the file, so all…

--

--

David Klempfner
The Startup

I’m a software developer who is passionate about learning how things work behind the scenes.