• 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
How does one update a view position during a core audio render callback?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How does one update a view position during a core audio render callback?


  • Subject: How does one update a view position during a core audio render callback?
  • From: "Patrick J. Collins" <email@hidden>
  • Date: Sat, 07 Mar 2015 09:17:29 -0800 (PST)

Hi,

So I have plotted out a waveform, and simply want to have a vertical
line represent a playhead which will move across the waveform's X-axis
as it plays.

I am using an NSBox as my playhead, and in my callback proc, I tried doing inside the loop:

  player->sampler.playheadView.position = player->sampler.playheadView.containerWidth / player->buffer.size * currentSampleIndex

my playheadView's position setter just does this:

-(void)setPosition:(NSUInteger)position {
    if (position == self.position) return;
    [self setFrameOrigin:NSMakePoint(position, 0)];
}

However, this causes everything to slow down to the point that the audio plays
with clicks and gaps inbetween the frames..

I changed this to do a performSelectorOnMainThread, where this operation
occurs, but it seems like the playhead only gets updated a handful of times
during playback, so it does not look good..

What is the ideal way to get visual feedback like this during playback?

Thanks!

Patrick J. Collins
http://collinatorstudios.com

 _______________________________________________
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: How does one update a view position during a core audio render callback?
      • From: Hamilton Feltman <email@hidden>
  • Prev by Date: Sample rate with bluetooth headphone and AVAudioSessionCategoryPlayAndRecord
  • Next by Date: Fwd: How does one update a view position during a core audio render callback?
  • Previous by thread: Sample rate with bluetooth headphone and AVAudioSessionCategoryPlayAndRecord
  • Next by thread: Fwd: How does one update a view position during a core audio render callback?
  • Index(es):
    • Date
    • Thread