Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9313335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:51:27+00:00 2026-06-19T01:51:27+00:00

I need to play 2 sounds with 2 AVAudioPlayer objects at the same exact

  • 0

I need to play 2 sounds with 2 AVAudioPlayer objects at the same exact time… so I found this example on Apple AVAudioPlayer Class Reference (https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html):

- (void) startSynchronizedPlayback {



NSTimeInterval shortStartDelay = 0.01;            // seconds

NSTimeInterval now = player.deviceCurrentTime;



[player       playAtTime: now + shortStartDelay];

[secondPlayer playAtTime: now + shortStartDelay];



// Here, update state and user interface for each player, as appropriate

}

What I don’t understand is: why also the secondPlayer has the shorStartDelay?
Shouldn’t it be without? I thought the first Player needed a 0.1 sec delay as it is called before the second Player… but in this code the 2 players have the delay…
Anyone can explain me if that is right and why?
Thanks a lot
Massy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:51:28+00:00Added an answer on June 19, 2026 at 1:51 am

    If you only use the play method ([firstPlayer play];), firstPlayer will start before the second one as it will receive the call before.

    If you set no delay ([firstPlayer playAtTime:now];), the firstPlayer will also start before de second one because firstPlayer will check the time at which it is supposed to start, and will see that it’s already passed. Thus, it will have the same behaviour as when you use only the play method.

    The delay is here to ensure that the two players start at the same time. It is supposed to be long enough to ensure that the two players receive the call before the ‘now+delay’ time has passed.

    I don’t know if I’m clear (English is not my native langage). I can try to be more clear if you have questions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to play and record at the same time. The problem is that
I am working on wordpress site. In this site i need to play sounds
I'm trying to play multiple sounds at the same time. The approach initially I've
I need to play a background sound all the time as long as my
I need some classes for playing short wav sounds, this classes would load this
Hi i am trying to play many sounds using AVAudioPlayer and foundation. The code
I have done an apk that play sounds (*.ogg) and now I need to
I need to play sounds (~5 seconds each) throughout my iphone application. When they're
I need to Implement an object(or sth else) to play sounds in Web. I've
I need to use HTML 5 audio to play sounds. However, the codec support

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.