[iOS] kAudioUnitSubType_AUiPodTime and background audio
[iOS] kAudioUnitSubType_AUiPodTime and background audio
- Subject: [iOS] kAudioUnitSubType_AUiPodTime and background audio
- From: "Hank Heijink (Mailinglists)" <email@hidden>
- Date: Mon, 11 Oct 2010 10:47:41 -0400
Hi all,
I have an application that plays audio through an AUGraph, and I've hit a bump in the road. Here's how the graph is set up:
AudioComponentDescription outputDesc = {kAudioUnitType_Output, kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple, 0, 0};
AudioComponentDescription mixerDesc = {kAudioUnitType_Mixer, kAudioUnitSubType_MultiChannelMixer, kAudioUnitManufacturer_Apple, 0, 0};
AudioComponentDescription iPodTimeDesc = {kAudioUnitType_FormatConverter, kAudioUnitSubType_AUiPodTime, kAudioUnitManufacturer_Apple, 0, 0};
AUGraph mGraph;
NewAUGraph(&mGraph);
AUNode outputNode;
AUNode mixerNode;
AUNode iPodTimeNode;
AUGraphAddNode(audioGraph, &outputDesc, &outputNode);
AUGraphAddNode(audioGraph, &mixerDesc, &mixerNode);
AUGraphAddNode(audioGraph, &iPodTimeDesc, &iPodTimeNode);
// These two lines are what will be replaced below
AUGraphConnectNodeInput(audioGraph, mixerNode, 0, iPodTimeNode, 0);
AUGraphConnectNodeInput(audioGraph, iPodTimeNode, 0, outputNode, 0);
AUGraphOpen(audioGraph);
...etc...
I left out the rest of the stuff, because the problem seems to exhibit itself here - let me know if you think that's relevant...
When I play audio through this graph on an iPhone 4 (iOS 4.1), audio plays fine but stops as soon as the screen goes blank or I hit the sleep button on the top of the iPhone. However, if I take out the iPod time unit by replacing the two lines referenced above with this:
AUGraphConnectNodeInput(audioGraph, mixerNode, 0, outputNode, 0);
audio keeps playing, even after the screen goes blank or if I hit the sleep button. This is the behavior I want. I verified that the audio category is right (kAudioSessionCategory_MediaPlayback), and everything else seems to be just fine: no errors are returned by any of the setup or rendering functions/callbacks. I've looked on the developer forums, the archives, and google in general and I haven't found anything about this.
Has anybody else seen this behavior? Any input would be greatly appreciated!
Thanks,
Hank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden