C# Audio Tutorial 10 - Plotting Audio Waveforms

GiawaVideos · 85K views · 2012 · 13:45

Open on YouTube

Audio & video engineeringPython, Ruby & scripting languagesSoftware (other)tutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when someone asks how to display or inspect a WAV file's waveform in C# and needs a working NAudio starting point.

Recommended by 3 people across 3 different months, 2013 to 2020.

What it is

A 2012 C# tutorial from the GiawaVideos audio series that shows two ways to draw audio waveforms: the plotting classes in the NAudio library and the Chart control built into .NET 4.0. The presenter admits neither renders waveforms very well and treats them as a starting point, with sample code and a demo wave file on his site.

What people said

Recommends Jecho Jekov · 2013-03 · Stack Overflow · on “Display a audio waveform using C#”

You can use the NAudio library [LINK] . See is the video tutorial [this video] on how to use NAudio to display waveforms.

Recommends ChristonianCoder · 2013-07 · Stack Overflow · on “How to compare waveforms of two soundtracks using .net?”

mesut! Assuming you are using C#.NET, I may have an answer for you. A simple Google search led me to this YouTube video, which shows you how to "Plot Audio Waveforms": [this video] Good luck, and the rest is up to you!

Recommends vr_driver · 2020-09 · Stack Overflow · on “Detect if there is voice in a wav file”

Take a look at these 2 videos. When printing the waveforms, it gives you values of when there is audio. You should be able to observe and pick what you need. [this video] [LINK]

Cites WoodyDev · 2018-07 · Stack Overflow · on “How to display audio signal on Universal Window Platfom (UWP) C#?”

There are a couple of options out there readily available. Here's just 2 of them: clarkezone/audiovisualizer [LINK] (VU Meters, spectrum & waveform plotting) NAudio.WaveFormRenderer [LINK] (Plots waveforms i.e. PCM data); Maybe this video [this video] will be useful as well Otherwise once (a while ago now) I used the old windows forms chart embedded into a WPF application (have a look here [LINK] if its useful).

Cites PiggyChu001 · 2020-02 · Stack Overflow · on “How to get the corresponding time of a byte from WAV file?”

I'm sorry that it's kind of hard to put this concept into the question title, maybe somebody could help, thanks! I was able to get the "byte-wised" waveform watching this video [this video] . Turned the whole WAV file into a byte array, now my question is: How could I get the corresponding time from the certain index of the byte array!? For example, b[3520] corresponding to 0.013s!? I had thought about maybe I could divide the total timespan of the WAV file by the total length of the bit array, then I would know how much time each byte occupy. But I was sketchy about the accuracy, is there any more accurate way to do such a thing!? Much appreciated.