Thanks Hamish, but I don't think this is correct, for two reasons.
First, Apple would have to have redefined and swapped established terms for
audio reference. "Average power" is a very specific thing, which is very
different than instantaneous power. Take a look at this image:
http://en.wikipedia.org/wiki/File:Peak-power-average-power-tau-T.png
Peak power is P(0), average power is P(avg), and instantaneous power is
p(t). So Apple is calling instantaneous power average power?*
I don't think so, for the second reason, which is I've tested this. I've
played an audio sample graphing both average and peak powers in a 2d graph.
If one of these was the instantaneous power, they should look like (half of)
the waveform graph. They don't. They look exactly like what you'd expect for
peak and average graphs. The peak graph tops out at the top of max power,
and average rises with peaks and slowly decreases until the next peak.
All that being said, you're right that it looks like average is being used
in _refresh. That's where I'm stuck. That's as far as I got before mailing
the list. Looking at avtouch, it seems like average is the answer. But when
I graph it out, it's clearly not instantaneous power, but rather true
average power.
Any thoughts?
Thanks so much for the help.
(*- average power is a very useful thing. It's the closest thing we have to
"perceived volume." I'm glad we have it, but it doesn't replace
instantaneous power.)
Quoting Hamish Allan <email@hidden>:
The "actual" power is available through -[AVAudioPlayer
averagePowerForChannel:]
See -[CALevelMeter _refresh] in avTouch/Classes/CALevelMeter.mm
Best wishes,
Hamish
On Fri, May 15, 2009 at 3:50 PM, Ochen Kaylan <email@hidden> wrote:
You're right, of course. My mix up. I've actually been going through the
code of avTouch, which does use AVAudioPlayer and has a meter that shows
actual power and peak power. It uses peakPowerPerChannel to calculate the
latter, but I can't figure out how it's calculating the actual power.
(I'm learning AudioQueue for one project while implementing AVAudioPlayer
in
another, and occasionally make a mistake like above. Sorry for that.)
So back to AVAudioPlayer, how do I get the current sample power? Is it
even
possible?
Thanks much.
On May 15, 2009, at 9:20 AM, Hamish Allan wrote:
Hi,
The version of SpeakHere I have in my Developer Examples does not use
AVAudioPlayer.
Best wishes,
Hamish
On Fri, May 15, 2009 at 3:14 PM, Ochen Kaylan <email@hidden> wrote:
Am I missing something, or is there no direct way in AVAudioPlayer to
get
the actual power of an AVAudioPlayer object sample? There's clearly
some
way
to get it, since the various metering apps (a la SpeakHere) show a
meter
with actual power levels along with (usually) the peak power levels. So
how
do I access the current level when the only properties available are
for
peak and average, neither of which return the actual current power?
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden