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:

fftHere 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.

Published 31 May 2009 01:23 PM by RiccioloCristian
Filed under: ,

Comments

# Andrew said on 28 June, 2009 02:40 PM

Cool man! Do you have an online demo ?

# Programista said on 29 June, 2009 10:32 AM

Hi. I can't find a contact to you so i'm ask here - do you plan to release a source code of this example, i'm also trying to find a way to sample mp3 data and your cade can be very helpfull.

# hans said on 08 August, 2009 04:44 PM

Great man! Waiting for the source. ( promesso!)

# Gilles Khouzam said on 20 August, 2009 02:27 PM

There is a port of an MP3 decoder to .NET, it should be easy to make it work in Silverlight. Unfortunately I don't have a link handy.

# proman said on 05 October, 2009 05:01 PM

And where is the src man ?

# Cristian Ricciolo Civera said on 19 October, 2009 01:07 PM

As you can see in my previous post , I'm working on MediaStreamSouce and audio/video processing.

# RiccioloCristian said on 19 October, 2009 01:08 PM

Sorry guys, I'm late.

Here you are my project with source code, including also audio peak meter.

blogs.windowsclient.net/.../new-codeplex-project-directshow-for-silverlight.aspx

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Search

Go

This Blog

Sponsors





Syndication

 
Page view counter