• 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: Observing CurrentPlayTime in AUScheduledSoundPlayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Observing CurrentPlayTime in AUScheduledSoundPlayer


  • Subject: Re: Observing CurrentPlayTime in AUScheduledSoundPlayer
  • From: William Stewart <email@hidden>
  • Date: Thu, 31 May 2007 14:52:13 -0700

But that's a fine approach. The reason that you don't get a notification for this is that it changes every sample, so at 44.1KHz it changes 44,100 times a second.

We take a similar approach as you do for drawing meters; set up some kind of time slice (30X a second) that you want to refresh the display, and then away you go. It also helps to optimise the amount of screen space you redraw when you are doing these.

Bill

On 31/05/2007, at 12:50 PM, Stephen F. Booth wrote:

Hello all,

I'm using an AUScheduledSoundPlayer to feed an AUGraph, and I would like to have an UI indication of playback position. Is there a way to observe changes in kAudioUnitProperty_CurrentPlayTime without polling? I've tried using AUEvents, but my callback is never called even when I know the property is changing (because audio is playing). Here is how I register for the event:

AudioUnitEvent propertyEvent;
propertyEvent.mEventType = kAudioUnitEvent_PropertyChange;
propertyEvent.mArgument.mProperty.mAudioUnit = _generatorUnit;
propertyEvent.mArgument.mProperty.mPropertyID = kAudioUnitProperty_CurrentPlayTime;
propertyEvent.mArgument.mProperty.mScope = kAudioUnitScope_Global;
propertyEvent.mArgument.mProperty.mElement = 0;

err = AUEventListenerAddEventType(_listener, NULL, &propertyEvent);


I was under the impression (after some googling and reading the list archives) that anytime an AudioUnit property changes, a notification should be generated, so I'm stumped. I also tried using AudioUnitPropertyListeners directly, but couldn't get that to work either.

Currently I'm using an NSTimer that fires every so often to query the property and causes an UI update- which works- but I don't like it.

Stephen _______________________________________________
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

--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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


References: 
 >Observing CurrentPlayTime in AUScheduledSoundPlayer (From: "Stephen F. Booth" <email@hidden>)

  • Prev by Date: Re: 'pass through' audio units
  • Previous by thread: Observing CurrentPlayTime in AUScheduledSoundPlayer
  • Index(es):
    • Date
    • Thread