Silverlight - Real time audio peak meter
I have implemented an audio peak meter for Silverlight. It uses two different ways: pre computed FFT or real time FFT.
The first technique is a console application that process audio file using DirectShow and produce a dat file containing peaks data, 12 frames per second. Then a DataAudioPeakMeter load this data file and it keeps MediaElement and BarVisualization synchronized. That works with any supported media types by Silverlight 2.0/3.0.
The second technique use a custom MediaStreamSource, called WavMediaStreamSource, that loads external wav file and provides raw samples to the MediaElement. This samples are also processed to flow BarVisualization animation.
Here is the result:
Here you can see a video demonstration of pre computed method.
Unluckily MediaStreamSource doesn’t allow to get audio raw samples decoded by Silverlight engine, so you can’t apply FFT on MP3/WMA file. You have to decode it using managed code (anyone has a decoder class?).
I hope in the future MS will give this possibility.