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 8710413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:37:15+00:00 2026-06-13T04:37:15+00:00

I am doing an application that involves playing back a song in a multi

  • 0

I am doing an application that involves playing back a song in a multi track format (drums, vocals, guitar, piano, etc…). I don’t need to do any fancy audio processing to each track, all I need to be able to do is play, pause, and mute/unmute each track.

I had been using multiple instances of AVAudioPlayer but when performing device testing, I noticed that the tracks are playing very slightly out of sync when they are first played. Furthermore, when I pause and play the tracks they continue to get more out of sync. After a bit of research I’ve realized that AVAudioplayer just has too much latency and won’t work for my application.

In my application I basically had an NSArray of AVAudioPlayers that I would loop through and play each one or pause/stop each one, I’m sure this is what caused it to get out of sync on the device.

It seemed like apple’s audio mixer would work well for me, but when I try implementing it I get a EXC_BAD_ACCESS error that I can’t figure out.

I know the answer is to use OpenAL or audio units but It just seems unnecessary to spend weeks learning about these when all I need to do is play around 5 .mp3 tracks at the same time. Does anyone have any suggestions on how to accomplish this? Thanks

  • 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-13T04:37:16+00:00Added an answer on June 13, 2026 at 4:37 am

    thanks to admsyn’s suggestion I was able to come up with a solution.

    AVAudioPlayer has a currentTime property that returns the current time of a track and can also be set.

    So I implemented the startSynchronizedPlayback as stated by admsyn and then added the following when I stopped the tracks:

    -(void) stopAll
    {
    int count = [tracksArr count];
    for(int i = 0; i < count; i++)
        {
        trackModel = [tracksArr objectAtIndex:i]
        if(i = 0)
            {
             currentTime = [trackModel currentTime]
            }
        [trackModel stop]
        [trackModel setCurrentTime:currentTime]
        }
    {
    

    This code basically loops through my array of tracks which each hold their own AVAudioPlayer, grabs the current time from the first track, then sets all of the following tracks to that time. Now when I use the startSynchronizedPlayback method they all play in sync, and pausing unpausing keeps them in sync as well. Hope this is helpful to someone else trying to keep tracks in sync.

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

Sidebar

Related Questions

I'm doing a project over the summer that involves entirely re-writing a large application
I am doing a application that deals with where Users can login and see
I am currently doing an android application that contains customize alert dialog. It contains
I am currently doing a C# WPF application that generates a table that does
I have a web application that will be doing some processing with submitted data.
Now i am doing an android application.In that application I am using asynchtask class
I have an application that after it finishes doing it's work schedules itself to
I've been given the task of doing maintenance to a iOS application that uses
No it's not that kind of basic question. I am doing a application and
I'm doing a kinect Application using Kinect SDK . The Result I want that

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.