• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [iOS] kAudioUnitSubType_AUiPodTime and background audio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iOS] kAudioUnitSubType_AUiPodTime and background audio


  • Subject: Re: [iOS] kAudioUnitSubType_AUiPodTime and background audio
  • From: "Roni Music" <email@hidden>
  • Date: Wed, 13 Oct 2010 09:04:37 +0200

Maybe you need to set
kAudioUnitProperty_MaximumFramePerSlice to 4096
as described in:
http://developer.apple.com/library/ios/qa/qa2009/qa1606.html

Rolf Nilsson / Roni Music


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
  • Prev by Date: Re: AU from scratch...?
  • Next by Date: Re: AU from scratch...?
  • Previous by thread: Re: [iOS] kAudioUnitSubType_AUiPodTime and background audio
  • Next by thread: Re: iPhone UIStatusBar turns red after backgrounding an AVAudioRecorder app that is not recording
  • Index(es):
    • Date
    • Thread