PDA

View Full Version : iOS audio streaming




mobappcoding
Sep 14, 2012, 12:14 PM
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!



linnxiu
Sep 25, 2012, 06:31 AM
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).

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 (http://www.chupamobile.com/products/details/635/Audio+Tunes/).