[iPhone] Can't play multiple compressed sounds, seems to block!

I'm writing an app that needs to play a variety of audio samples of different lengths back to back, but only one at a time. The system I came up with works great when using WAV files or whenever running on the simulator no matter what audio type, but on the iPhone itself the logic breaks if I use a compressed audio format like MP3 or AAC. I don't want to ship 5MB of audio when it could be 500K, so this is a serious problem for me!
I think the bugs have to do with the iPhone's hardware acceleration for compressed audio, and certain playback behaviors changing in this context, but I'm not positive.
Basically, I have a list of 18 samples. I load each into it's own queueable object with it's own queue reference and buffers. If nothing is playing, I pick the first object randomly and play it, wait for it's queue's isRunning property to go false, then play the next sample upon completion. Fine, right?
However, when using MP3s, the first sample I play works just fine, but all the other sounds fail to play, stopping immediately (messing up my event logic). Interestingly, when I loop all the way back around to the original sample, it plays again just fine! It doesn't matter which file I play first... the first file always works great, but appears to block the output of all the other sounds that come later, even though it can be correctly played again itself.
The return codes for all of my AudioQueue calls are 0, even when the audio for a sample doesn't play, and I see a reasonable number of buffering messages as if it's reading and enqueueing each and every file correctly. I'm even flushing the object's queue before calling stop, and resetting the object's queue after the 'isRunning' property goes false, to no avail.
Can anybody describe the magic incantation that allows multiple compressed audio files to be played through the AudioQueue engine, one at a time, without them blocking each other's output? Am I missing something simple?
Help!

At this time .Mov files are not compatible with the iPhone.
The website would need to re-encode their movie into an H.264 video
iPhone Video Specifications posted below
http://support.apple.com/specs/iphone/iPhone.html
Video
Video formats supported: H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 768 Kbps, 320 by 240 pixels, 30 frames per second, Baseline Profile up to Level 1.3 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats

Similar Messages

  • How can I play multiple movies on quicktime like a list format

    ok one more time How can I play multiple movies on quicktime. When i click on open file it will only let me choose one movie to play.For example When ever I used windows media player I could drag my mouse over numerous files and it would play them one after another like in a list format. Can anyone help with this?
    Thank you

    I would like an answer on this also. It gets to be a hassle to play multiple files when playing on the television.

  • How can I play multiple movies on quicktime like I can on windows medplayer

    How can I play multiple movies on quicktime. When i click on open file it will only let me choose one movie to play.For example When ever I used windows media player I could drag my mouse over numerous files and it would play them one after another like in a list format. Can anyone help with this?
    Thank you

    Hi Brennan,
    Only HDMI is going to support audio & video on the single cable. Which MacBook Air do you have? Here's a great article regarding this - http://support.apple.com/kb/HT4241. Also keep in mind that only the current generation of MacBook Airs support this. The previous generation, also with MiniDisplay Port would support HDMI but you'd need to run a separate line from the headphone port over AUX for audio.
    The first and second generation models, which have micro-DVI, do not support audio. Regarding the RCA cables, Apple offers adapters that allow you to go to VGA and that would probably be your best bet. I do not believe there's a MiniDisplay Port to RCA solution out there, you'd need to do multiple adapters and that's always a questionable performance solution.

  • IOS7 (iPad or iPhone) can't play music over airport

    iOS7 (iPad or iPhone) can't play music over airport?  I don't see the little arro that let's me pick the airport for music to the audio system.

    New way of doing this is to sweep your finger up from the bottom of the iPhone screen; you see a sort of control panel with things like airplane mode, bluetooth etc across the top. And 3/4 of the way down the little arrow thing you used to see beside in "music" to choose the AirPlay or Base Station.
    Not exactly intuitive.

  • Iphone 4 when playing game no sound

    hi guys:
    my iphone 4 when playing game no sound but the ringstone is ok no problem,so i try to reset my phone but the problem still there~is that my hardware problem?

    Hello Zijie92,
    Thank you for the details of the issue you are experiencing with sound on your iPhone.  Have you checked to see if the Side Switch is enabled?  This could be muting the audio:
    In ring mode, iPhone plays all sounds. In silent mode, iPhone doesn’t ring or play alerts and other sound effects.
    iPhone User Guide - Ring/Silent switch
    http://help.apple.com/iphone/7/#/iph3bd01398
    If you are experiencing this issue with just one specific application, I recommend the steps in the following article:
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/ts1702
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Ios 8 iphone can not play audio message in imessage

    Seems I can send sound clips from my iPhone 5, but when someone sends me one I get a box with a ? in it and can not play it even though it says I have received an audio message. If I am at the lock screen I can hit play but then it appears to freeze.
    Any ideas? Below is what I see in my messages.. they should be audio messages.

    Just downloaded it about an hour ago and the same thing happened to me. I guess I should just wait it out then?

  • How can I play multiple episodes of a podcast in iTunes 11?

    Hi there - I'm subscribing to a number of podcasts in iTunes 11. I would like to play multiple episodes of a podcast one after the other without having to start each one separately, and preferably without having to create a playlist each time. Any ideas?
    Thanks!

    I do not have an 'My Podcasts' option.  Ihave Podcasts and On this IPod
    In Podcasts if I click on a podcasts no options display.
    Also, why do some of my podcasts now delete automatically after they have been played and some do not.
    I have my Settings set to not auto delete
    I have to say that Apple seems to screw more things up than it fixes.  I would suggest when you include new options you default it to keep it as it was before upgrade so people can choose to use it and not have to reset things not to use it

  • Updated iPhone no longer plays on bose sound dock 10, or car adapter

    I phone 4s used to work fine on Bose sound dock 10, and connector in Lexus LS 460, 2008.  Both devices stopped connecting after recent upgrade.

    Thanks for the replies - yes, we are going to try resetting the Alpine unit and if this doesn't do it, wait for the next iPhone software update due in the next few days which I'm really hoping will rectify it. Will post again when there is any result.
    It is very strange though, it worked fine even after updating to iOS4 months ago, and has only stopped working and displays "Error 01" in the last couple of weeks. I can still make and receive hands free calls via Bluetooth, just can't play music.

  • Can You Play Multiple Playlists Without User Intervention

    Can you stack and play multiple playlists? ie if you had three playlists of 50 songs each, could you pick all three, play all the songs in the first playlist, when it is finished move automatically to the second playlist play its songs then automatically move to the third without user intervention? And if so, can you play each of these in shuffle mode?

    There's no "impromptu" method of doing so that I know of.
    As far as un-impromptu methods (it's always fun inventing words), it will depend on whether you want to listen to this mega-playlist on an iPod or just with iTunes.
    If it's just with iTunes, you can go to the File menu > New Folder command and create a new folder which we can call the Mega-Playlist folder. Drag the three playlists in question into that folder. When you select that folder and press Play, iTunes should go through all the songs.
    If it's on an iPod, since Folders don't transfer over from iTunes, the only solution I know of would be to create a Smart Playlist with iTunes that will -
    Match any of the following rules:
    Playlist is the first playlist +
    Playlist is the second playlist +
    Playlist is the third playlist.
    Synching this mega-playlist to your iPod will allow you to select it from the Playlist menu.
    Shuffle mode would shuffle songs from all three playlists together, not shuffle songs from the first playlist before moving on to shuffling songs from the second playlist before shuffling songs from the third playlist.

  • My iPhone4 can't sync to Itunes after I have updated the iPhone to ISO5.0. now my iPhone can't play music. whenever i go to play my music on my iPhone it just reverts back to the playlist. hopeless! ISO5.0 is as bad as Microsoft stuffs.

    I have recently updated the iTunes in order to update both my iPhone and iPad to ISO5.0. unfortunately, after the updated, my iPhone is no longer playing any music. whenever i go to play music on my iPhone it just reverts back to the playlist or it keeps running through song to song. But still, no music is on.
    I tried to re-sync the music library, error mesage prop up,
    "The iPhone 'xfdsarw' could not be synced because the sync session failed to start"
    I delete the iTunes and download it again. Then, I restore my iPhone to the version before ISO 5.0. After, I do the updated again. However, the problem still exists. What should I do? Please advise. I cant believe that iPhone cannot play iTunes!!!!
    How come, apple acts like Microsoft? I saw this problem had existed in the developer stages back to the past summer. Then, you guys didnt fix it before the release of ISO 5.0. Hopeless. As being a life-long apple fan, I am so disappointed! Wordless  ....

    My music can be played in my iMac and iPad itunes, but not my iPhone4.
    i did what you have suggested to unsync the music and then re-sync again. should i try to cancel all the music in the library and then restore them again. can it work? i dont want to bet coz reloading so much music is very trouble. 

  • IPhone can't play songs and import songs from PC at my workplace. Why?

    Hi. I just bought an iPhone and i set up my iphone on itune at home and have also imported the songs from there into the iphone. But, when i connect my iphone to the itune at my workplace, i can't play the songs i already have in my iphone on itune or import any songs from the itune into my iphone. (the songs (of my iphone) is shown light grey on itune.
    Why? Can anyone help to answer that?

    Hi, I'm reading your answer regarding erase and replace... I haven't tried to use 2 computers at once. My nephew showed me how to sync music, by using his computer. When I got back to mine... it erased all he has synced. (I understand that) However, it will not record anything from mine.
    Green light comes on and says it's syncing, but I can't even get ringtones synced.
    I am computer 'functional' ... not 'literate' Thanks in advance.

  • Can Flash play multiple audio and video files at the same time?

    Hello,
    I would like to create a web-based client/application that
    can play multiple a/v files or stream multiple a/v files at same
    time. Is this possible with Flash, without the use of RTMP? If yes,
    can you please provide an example. Thanks in advance.
    Regards,
    Nilang

    You never edit within a clip. The purpose of opening a clip is to make sync adjustments, audio equalization, color correction, stabilization, things that you might want do overall to the master clip before you edit it. You edit the portion of the clip you want from the browser into a project. There is really very seldom any need to open a clip into the timeline.

  • How can I play an old sounder?

    How can I play an old Jeff Routemann abc news sounder on my new IMac?

    What is a sounder?
    A high tech wood smoothing device that uses sound?

  • How can I play multiple albums from same artist in album order on iPhone 4?

    Just purchased an iPhone 4 from Verizon. When I select an Artist and then choose "All Songs", the only choice I am provided is to play the songs in alphabetic order. I would prefer to play them in the original album order. Is there a setting that can be changed to accomplish this?

    For those who arrive here later than this answer, the app is now called "Continue" & is available free with addware or paid without.

  • When I play a video on my Apple TV from my iPhone can I still have the sound come out of my iPhone instead of my tv?

    When I play a video on my Apple TV from my iPhone (airplay) is it possible to have the sound come out of my iPhone instead of my tv?

    No

Maybe you are looking for

  • My recovery drive is not visible in my hp pavilion g6-2137tx

    My problem is very big. I installed ubuntu alongside with windows 7.For that ubuntu created a special drive of  83 gb. After installing ubuntu my recovery drive was just shownig some text files but the recovery drive was full and still there.. so i d

  • Vendor Bank_Pmt

    Hello Friends, Vendor "A" has 10 bank accounts. There are 10 open invoices which we need to pay to Vendor "A" i want to settile Inv.No.1 to vendor Bank.No.1                        Inv.No.2 to vendor Bank.No.2                        Inv.No.3 to vendor

  • OSB Service with Oracle AQ with payload type SYS.AQ$_JMS_TEXT_MESSAGE

    I am trying to write a web-service to Enqueue/Dequeue messages from an AQ with payload type SYS.AQ$_JMS_TEXT_MESSAGE defined in Oracle DB. In my understanding is that I need to create a JMSModule within weblogic with a ForeignServer defined within it

  • Path/Direct Selection tool problems

    So, I switched form cc to cc 2014. Because it seems, that everything works fine in the newer Version. But now I realized some issues with the Path Selection Tool. Sometimes I need to select multiple forms or anchor-points with the tool, but while I'm

  • Pdf file shadows

    when I select a pdf file from the internet , at first it appears fine but then it blurs with shadows as soon as I use the mouse to view the text