Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitoring input level



So you have two problems to solve. The first problem is how to get at the input data streaming in from the audio device. For that, you can use an instance of the HAL output unit. You can find a discussion and sample code for doing this here: http://developer.apple.com/technotes/ tn2002/tn2091.html

Once you have your hands on the data coming in from the device, the other problem you have to solve is computing the actual meter values and displaying that on the screen. There are a variety of techniques for doing metering. Which one you use depends on the effect you are trying to achieve. They range from the very basic of scanning a buffer and pulling out the sample with the largest absolute value to more complex ways of computing signal power over time. A good digital audio text ought to cover most of the math.

On Jun 18, 2006, at 11:40 PM, Neil Clayton wrote:

Hmm. I may be able to answer some of my own question.

I've looked at the MatrixMixerTest, and I see that it uses the AUGraph (mixer) plus AudioUnitGetParameter to get hold of avg power and peak power.
It seems somewhat complex to me (settings up the AUGraph, making sure formats are correct, etc). I was naively expecting a 'GetPeakPowerFromAudioDeviceID() function'. From my reading so far, I'm assuming the inputProc is required only to feed data INTO the mixer (to have something to sample). So my questions are now:


1) For monitoring audio, is using an AUGraph + AudioUnitGetParameter the preferred way to go?
2) Assuming it is; How would I pipe input from say, a micrphone, into the mixer? Should I be using AUHAL?


Sorry if these are newbie questions. I'm still very new to CoreAudio (and audio processing in general).



On 17 Jun 2006, at 13:16, Neil Clayton wrote:


Is there a method I can use in CA to monitor the input level of some device?
I'd like to do something similar to the input level monitor in System Preferences / Sound.


--

Jeff Moore
Core Audio
Apple


_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden
References: 
 >Monitoring input level (From: Neil Clayton <email@hidden>)
 >Re: Monitoring input level (From: Neil Clayton <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.