Re: Sound Level meter - Audio Newbie
Re: Sound Level meter - Audio Newbie
- Subject: Re: Sound Level meter - Audio Newbie
- From: Michael Thornburgh <email@hidden>
- Date: Wed, 23 Oct 2002 13:22:54 -0700
the data as it comes to your IOProc is just 32-bit floating
point numbers between -1.0 and 1.0. you don't need to do
any decoding other than knowing how many channels are in
each stream, so you can de-interleave the samples and do
the level computation per-channel.
AudioHardwareSetProperty with kAudioDevicePropertyVolumeScalar
(or kAudioDevicePropertyVolumeDecibels) will adjust the hardware
gain of the device, if it's settable at all.
-mike
and PCM stands for "Pulse Code Modulation". the short version
is that a digitization of an instantaneous sampling of an audio signal
is called a "pulse code".
On Wednesday, October 23, 2002, at 11:42 AM, Greg Wilson wrote:
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.
_______________________________________________
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.