Is it possible to play two audio files simultaneously?

Discussion in 'iOS Programming' started by sspbond007, Sep 15, 2008.

  1. sspbond007 macrumors member

    Joined:
    Aug 19, 2008
    #1
    Hi,
    Is it possible to play two audio files simultaneously.

    I modified the 'SpeakHere' to play two audio files simultaneously, it worked perfectly on simulator but get hanged on iphone.

    To this I implemented NSTimer, which regularly checks for both player instance every second.As soon as any player gets stopped Timer task stops the second one forcefully and again starts both.

    thanks.
     
  2. Nall macrumors regular

    Joined:
    Aug 15, 2003
    #2
    It should work if the two streams are not compressed.
     
  3. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #3
    I'm using one mp3 and other is caf file.
     
  4. Nall macrumors regular

    Joined:
    Aug 15, 2003
    #4
    I've done precisely this and it worked fine.
     
  5. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #5
    Can You Please share our code?
     
  6. Nall macrumors regular

    Joined:
    Aug 15, 2003
    #6
    Used the CrashLanding code.
     
  7. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #7
    I downloaded the CrashLanding application. But it does not play any sound.
     
  8. Nall macrumors regular

    Joined:
    Aug 15, 2003
    #8
    It does not play any sound in the simulator in 2.0 -- it's some sort of SDK bug. Try it in the 2.1 simulator, or on a real device of either version.
     
  9. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #9
    Thanks ,
    Yes, you are right. Its working for 2.1 simulator.

    I played files of crashlanding in my application with success. But when I add another file to play it gives following error
    Code:
    Error attaching data to buffer
    : a003
    Error loading looping file info: 40963
    
    Please help me.
     
  10. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #10
    Hi,
    thanks,
    I got the point, It is playing the .caf files recorded from SpeakHere application.But could not play any other .caf files in my system.
    Anyways for the time being this is not my issue, I want to play mp3 files.
    How can I do this with CrashLanding Code?
    Please help me.
     
  11. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #11
    Hi

    I found the problem, my simulator option was set to version 2.0 by mistake, thats why it was not playing other files.
    Anyways I have no issues now.

    Special thanks to Nall for his support and guidance.
     
  12. sspbond007 thread starter macrumors member

    Joined:
    Aug 19, 2008
    #12
    Application working perfectly fine on simulator, but not on device, there it play only single file.
     

Share This Page