iOS audio streaming

Discussion in 'iPhone/iPad Programming' started by mobappcoding, Sep 14, 2012.

  1. mobappcoding, Sep 14, 2012
    Last edited: Sep 25, 2012

    macrumors newbie

    Joined:
    Sep 14, 2012
    #1
    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!
     
  2. macrumors newbie

    Joined:
    Sep 18, 2012
    #2
    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.
     

Share This Page