db display

View: New views
2 Messages — Rating Filter:   Alert me  

db display

by _angelo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Any suggestion is appreciated.

Greetings,
Angelo

_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Re: db display

by Jason Daly :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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"

_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal