Sound Level meter - Audio Newbie
Sound Level meter - Audio Newbie
- Subject: Sound Level meter - Audio Newbie
- From: Greg Wilson <email@hidden>
- Date: Wed, 23 Oct 2002 14:42:51 -0400
I've been trying to learn Cocoa by putting together a "simple"
sound-input-capture-to-file program similar to "Coaster". I found a number
of useful tidbits on this lists' archives which have enabled me to
accomplish the main functionality. I add an IOProc to the default input
device using AudioDeviceAddIOProc, start it using AudioDeviceStart and
capture the data to a file I created using AudioFileCreate.
It's time to add some bells and whistles. The first thing I'd like to add is
a simple sound level meter and control (like on the sound input system
preference) but it has me stumped.
The only example code in the archives required adding a callback to the
render proc of an audio unit to create the meter. Since I'm using the Audio
Device I don't have an AudioUnit to add the proc to. I have the data as it
comes in from the buffer, but I don't know how to decode it. Glancing at the
number of format flags for linear PCM data leaves me wondering if "decoding"
the data is the right way to go. But I also can't find an alternative.
I'm hoping I can use AudioHardwareSetProperty with
kAudioDevicePropertyVolumeScalar to handle the volume control but haven't
tried it and don't know if this is the right way to go.
Can someone offer me some guidance for these two items?
Thanks
Greg
Ps what does the PCM in linear PCM stand for?
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.