[gst-devel] How to simulate a VU meter?

Stefan Kost ensonic at hora-obscura.de
Sat Nov 13 22:22:26 CET 2010


Am 13.11.2010 02:11, schrieb Erik Blankinship:
> What is the best way to simulate a VU meter [1] with gstreamer?  ( Preferably, I
> would get value readings as a percent... unless  I make it go to 11 :-) )
> 
> I am currently grabbing buffers on their way to a fake sink, and then using
> numpy in python extracting an average value out of the buffer:
> 
>     temp_ay = np.asarray( fromstring( buffer, 'int16'  ) )
>     v = 0
>     for b in temp_ay:
>     v = v + abs(b)
>     avg = v / len(temp_ay)
> 
> 
> 
> Using this approach, I don't know what the upper bound is... I just get some
> value which appears to go up and down as I make noise.  


Does it have to be a VU Meter, or is the "level" element enough?

Stefan

> 
> This works, but surely there is: (1) a better way; (2) some way to know what the
> upper bound is so a percentage can be calculated?
> 
> Thanks!
> 
> [1] http://en.wikipedia.org/wiki/VU_meter
> 
> 
> 
> ------------------------------------------------------------------------------
> Centralized Desktop Delivery: Dell and VMware Reference Architecture
> Simplifying enterprise desktop deployment and management using
> Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
> client virtualization framework. Read more!
> http://p.sf.net/sfu/dell-eql-dev2dev
> 
> 
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list