[Gambas-user] How to display a VU meter

RICHARD WALKER richard.j.walker at ...247...
Tue Jun 12 04:15:33 CEST 2012


If you were using Jack then I would suggest you simply use an existing
meter such as meterbridge (http://plugin.org.uk/meterbridge/) and
perhaps embed it in you Gambas program's window. That would give you
the choice of DPM, analogue VU or Peak so you could pick whichever
suites your layout.

If you are using plain Alsa, or even Pulse (see how I managed to
repress the shudder?), there may be other existing solutions you could
apply in the same way.

If you must re-invent the wheel in Gambas then it would be easiest
just to normalise the audio data, say in the range 0-1, and send
representative updates to something like a progress bar (or two, for
stereo). That would give you something to look at while you are
hacking out a suitable data snooping and sub-sampling method. Remember
that you will be getting thousands of samples per second, but the
refresh rate (or the event loop) will be much less often and you might
get away with averaging a few hundred milliseconds worth.

It is entirely up to you whether you want to emulate a real
measurement indicator (such as PPM or VU) or just have something which
looks good. In the end, when you have got the right algorithm for your
purposes, you can dump the progress bars and work on something
prettier.

Richard

On 12/06/2012, Grant Taylor <zl1wtt at ...43...> wrote:
> Hi all,
>
> I'm currently work on my multimedia software I have got it working with both
> Mplayer and VLC. Is there a simple way to write code to work in with the
> desktop sound mixer to display a VU meter? I need to read both input and
> output settings to generate a visual display. My aim is monitor sound levels
> been sent out to my sound card from Mplayer or VLC.  I'm looking around for
> example on how to do this but not found any so far. I also would like find
> out more about plugging in and out of sound cards from Gambas?
>
> Grant
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list