Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mobappcoding

macrumors newbie
Original poster
Sep 14, 2012
1
0
I need to send and receive audio files within my app. I want to stream this data.
i'm building an App that uses audio streaming. i'm using the AudioStreamer class. The audio streamer has different state isPlaying, isPaused ,isWaiting, and isIdle . how can i queue the Audio when i get a phone call if the Audio is in the state isWaiting? I got this error "Audio queue start failed." Help me!
 
Last edited:

linnxiu

macrumors newbie
Sep 18, 2012
2
0
I need to send and receive audio files within my app. I want to stream this data.
i'm building an App that uses audio streaming. i'm using the AudioStreamer class. The audio streamer has different state isPlaying, isPaused ,isWaiting, and isIdle . how can i queue the Audio when i get a phone call if the Audio is in the state isWaiting? I got this error "Audio queue start failed." Help me!

An interruption as receiving a call will deactivate the Audio Session. It's up to you to, in your interruption handler, re-activate the Audio Session with AudioSessionSetActive(true).

Code:
else if (state == AS_PAUSED)
{
  err = AudioQueueStart(audioQueue, NULL);
  if (err) {
    err = AudioSessionSetActive(true);
    if (err) {
      [self failWithErrorCode:AS_AUDIO_QUEUE_START_FAILED];
      return;
    } else {
      err = AudioQueueStart(audioQueue, NULL);
      if (err) {
        [self failWithErrorCode:AS_AUDIO_QUEUE_START_FAILED];
        return;
      }
    }
  }
}

For more complex features check this Audio streaming source code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.