[Openal] db display

Jason Daly jdaly at ist.ucf.edu
Mon Jun 8 08:56:41 PDT 2009


gmail wrote:
> Hi all,
>
> i am looking for a suggestion, to know if and how OPenAL library could 
> be useful in a simple program.
>
> I need to display in a little visual appl, the decibel of the audio 
> input. I can calculate it if i could get the samples millivolts value in 
> input.
>   

Open a capture device (see the spec or examples for how to do this), and 
start capturing.  You can then examine the samples to see the amplitude 
of the incoming signal.  Just scan each set of incoming samples to find 
the peak, and set your meter to show that peak value.

To make it a little smoother, you can cause the meter to decay slowly.  
Just divide the current meter level by a "falloff factor".  If the peak 
of your new set of samples is below the current meter level (after 
applying the falloff), then leave it alone.  Otherwise, update the meter 
with the new peak value.

--"J"



More information about the Openal mailing list