• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Peak and averagePowerForChannel are nice, but what about the actual current power?


  • Subject: Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
  • From: Ochen Kaylan <email@hidden>
  • Date: Fri, 15 May 2009 23:39:39 -0500

Thanks Brian.

Ambiguity: You're right. I didn't mean that I needed the power of 1/60th of a second of audio, since many samples are included within that 1/60th of a second. What I meant was that I only need the actual power of one sample every 1/60th of a second. There will be plenty of samples that will not be counted between those single samples every 1/60th of a second. For my needs, that's fine.

Average not spanning multiple buffers: I'm not sure I follow you here. The only time I'm having a problem with falloff is using the AVAudioPlayer meter functions. Are you saying that there is a way to set the falloff time of AVAudioPlayer meter readings? I'm not aware of one, so if there is, can you point me to where I can find out more about it? If you're saying that by using AudioQueue, I can limit falloff, why would I do that if I can access the actual sample levels and avoid falloffs all together? I don't think I'm following what you're saying.

Why the need: There are a few different reasons I need the instantaneous power. The easiest one to explain is waveforms. You can't draw waveforms with only average or peak power. If the audio is 10 minutes long, but the waveform is only going to be 100 pixels wide, there's no need to have the instantaneous power of every sample. A few a second is plenty for that scenario. Do you have any suggestions on how a waveform can be drawn without digging into the PCM data, mapping the entire file, averaging the instantaneous powers to fit the display needs, and rendering it out? I'm fine doing it that way, but that's not easy on the processor, nor is it terrible quick. Pulling meter data from an AVAudioPlayer is a snap, if only instantaneous power was retrievable.

Thanks again for following up on this. I look forward to any thoughts you might have.




On May 15, 2009, at 5:01 PM, Brian Willoughby wrote:


On May 15, 2009, at 11:50, email@hidden wrote:
I don't need sample-level granularity. 1/60th of a second is fine, but I need the true level, not an averaged level, and the falloff is longer than 1/60th of a second.


There is an inherent ambiguity in your request for the instantaneous power for 1/60th of a second. There are hundreds, if not thousands of 'instants' in that time period. You need to define whether you want the largest instantaneous power during that period, or the average, or the minimum, or the mean, or what. You certainly cannot update your meter tens of thousands of times per second.

Your best bet is to get the full PCM audio data in your code and compute your own power, using your own definition. You could design your averaging so that no state is saved between buffers, and thus there would be no falloff. That still isn't instantaneous power, but it's an average power which does not span multiple buffers.

Brian Willoughby
Sound Consulting

P.S. What is this to be used for? Why do you seek instantaneous power?


_______________________________________________ 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
  • Follow-Ups:
    • Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
      • From: Brian Willoughby <email@hidden>
    • Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
      • From: Hamish Allan <email@hidden>
References: 
 >Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Ochen Kaylan <email@hidden>)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Hamish Allan <email@hidden>)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Ochen Kaylan <email@hidden>)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Hamish Allan <email@hidden>)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: email@hidden)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Hamish Allan <email@hidden>)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: email@hidden)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Hamish Allan <email@hidden>)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: email@hidden)
 >Re: Peak and averagePowerForChannel are nice, but what about the actual current power? (From: Brian Willoughby <email@hidden>)

  • Prev by Date: Re: AUGraph mixer callback on inputs
  • Next by Date: Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
  • Previous by thread: Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
  • Next by thread: Re: Peak and averagePowerForChannel are nice, but what about the actual current power?
  • Index(es):
    • Date
    • Thread