• 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
Stutter when playing audio clips using AV
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stutter when playing audio clips using AV


  • Subject: Stutter when playing audio clips using AV
  • From: Will Archer <email@hidden>
  • Date: Tue, 6 Jul 2010 14:01:46 -0600

Hi guys, I'm running into a strange glitch in AVAudioPlayer and I'm wondering what I'm doing wrong.  I'm running an app which uses offline rendering to play background music (with a little processing) and play instructional audio clips on top using AVAudioPlayer.  This all works as I'd like it to.  The trouble I'm running into is AVAudioPlayer occasionally introducing a stutter in the instructional clips.  For example, if the original clip was "Ok, go for five minutes", it plays back as "Ok, go for five minutesminutes".  I have also heard instances where a minor portion of the audio is omitted.  The audio is not distorted or phased in such a way as to suggest that the clip is being played twice in rapid succession, and AVAudioPlayer doesn't return any errors when initiate playback.

My code for playing audio clips follows: (edited for brevity)

- (BOOL)playURL:(NSURL *)url{

        NSError *error;
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
if (error) {
NSLog(@"Couldn't init url: %@", [url absoluteString]);
return NO;
}
player.delegate = self;
if (![player prepareToPlay]) {
NSLog(@"Error could not prepare %@ for playing", [url description]);
return NO;
}
player.volume = 1.0;
@synchronized(self) {
if (queueStatus == PLAYING) {
AudioSessionSetActive(YES);
[player play];
}
        }
        return YES;
}

 _______________________________________________
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: Stutter when playing audio clips using AV
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: 2 AUCocoaView implementation questions: How to deal with uninitialized AU, and restrict Host to single view.
  • Next by Date: QuickTime GM Synth for iPad?
  • Previous by thread: USB device speed query
  • Next by thread: Re: Stutter when playing audio clips using AV
  • Index(es):
    • Date
    • Thread