Playing Concurrent Sounds

Discussion in 'iOS Programming' started by tsornin, Nov 29, 2008.

  1. tsornin macrumors newbie

    Jul 23, 2002
    I'm using AudioServicesPlaySystemSound to play a short sound (3-4 seconds long) when a user taps a button. However if the user taps the button again before the sound finishes playing, the sound starts over from the beginning... truncating the first sound.

    Is there a way to play the same sound concurrently, so if the user presses the button every second, then they get overlapping sounds? If I switch to an Audio Queue will it fix the problem?
  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    Audio queues will help if you either use multiple queues, or implement a software mixer.

  3. xsmasher macrumors regular


    Jul 18, 2008
    You can play more than one sound at a time with the method your using, but you have to use multiple soundID's - just call AudioServicesCreateSystemSoundID, and then AudioServicesPlaySystemSound on the ID you got back.

    I suspect your code is only creating one soundID, and then calling play on that soundID multiple times. That would behave as you described - it would restart the single sound from the beginning.

Share This Page