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

# Online Pharmacy said on 26 January, 2010 04:33 AM

I found your site on Google and read a few of your other entires. Nice Stuff.

I’m looking forward to reading more from you.

# Buy cheap software said on 12 November, 2011 04:39 PM

jM2qlk I envy you. The content and design of your blog is much better than mine. Who made a design for you?!....

# Cheap oem software said on 12 November, 2011 10:16 PM

mFqAgM Comrade kill yourself..

# Darold said on 10 January, 2012 11:06 AM

You get a lot of respect from me for writing these helpful atrciles.

# Cactus said on 13 January, 2012 02:23 AM

Gee whiz, and I thohgut this would be hard to find out.

# buy cheap oem software said on 15 January, 2012 08:58 AM

wRUXD4 comment2

# oem software said on 16 January, 2012 11:31 AM

yxbqDA comment2

# buy cheap oem software online said on 17 January, 2012 02:22 AM

EwpfA5 comment5

# buy cheap oem Software said on 18 January, 2012 09:59 AM

BPD9yP Good day! I do not see the conditions of using the information. May I copy the text from here on my site if you leave a link to this page?!....

# health and safety courses said on 25 January, 2012 02:58 PM

Hi! Everyone who reads this blog - Happy Reconciliation and Accord..!

# SEO Company said on 02 February, 2012 05:21 AM

This article is for professionals..!!

# Google Panda Update said on 02 February, 2012 08:02 AM

Comrade kill yourself..

# Lynda said on 06 February, 2012 11:28 AM

I love reinadg the ROFL nominees each month, they're always gold.

Leave a Comment

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

Search

Go

This Blog

Sponsors





Syndication