I'm looking for a library that can give me an image (think .png) from an audio file with configurable height and width. Waveform image is something like this:

I'm planning on using it in my C# app. The audio file may be in various formats like mp3, flac and ogg.

3 Answers 3


You can do this in python as detailed in this SO answer. The python could be used offline or you can embed python within programs written in other languages.

  • From what I understand, the linked question has answers describing how to make a custom waveform drawing method in python and using its mathematical plot drawing libraries. This seems like a lot of unnecessary steps. Nov 15, 2014 at 12:48
  • 12 Lines of code doesn't seem a lot of work to me! Nov 15, 2014 at 15:12
  • It's not about work, it's about quality and reliability. I don't know what I'll get using that. Probably exceptions. And besides it's a lot more work if you want to use Python libs in a C# app. Nov 15, 2014 at 19:28

NAudio is a free (MS Public License) library for audio processing in C#.

The Youtube video shows how to add controls to Visual Studio for audio visualization.

This Stack Overflow question shows some code that reads an MP3 file with NAudio and paints a PNG file.


audiowaveform is a C++ command-line application that generates waveform data from either MP3, WAV, FLAC, Ogg Vorbis, or Opus format audio files.

enter image description here

It specifically supports PNG output

See the CLI options for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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