Re: A number of simple questions
Re: A number of simple questions
- Subject: Re: A number of simple questions
- From: Andy Davidson <email@hidden>
- Date: Wed, 14 Nov 2012 17:09:19 -0800
- Thread-topic: A number of simple questions
Hi Seth
On 11/14/12 3:08 PM, "Seth Willits" <email@hidden> wrote:
>
>- How many frames should I render at a time? 512? 1024? Any reason to
>stick to power of two? I imagine the answer might depend on whether this
>rendering has to happen in real-time or not. If I'm calling
>AudioUnitRender() for offline rendering, and I'm interleaving with video
>at 30 fps, and my audio is 44.1khz then is there an advantage to grabbing
>1470 frames (1/30th of a second) versus 512 frames at a time? Does the
>number of frames I render matter if, say, the destination is AAC?
>(Perhaps there's some minimum or maximum number of frames to give it?)
This depends on if you are running on Mac OS or IOS
I assume you are working with AudioUnits, on IOS when the screen locks by
default the buffer size changes.
///////////////////////////////////////////////////////////////////////////
////
- (void) configureAudioUnitSoPlaybackContinuesWhenScreenLocks:(AudioUnit)
au {
//
// see Technical Q&A QA1606 "Audio Unit Processing Graph - Ensuring
audio playback continues
// when screen is locked"
// http://developer.apple.com/library/ios/#qa/qa1606/_index.html
//
// set the audio unit to handle 4096 samples per slice since we want
to keep rendering during screen lock
// when screen locks the buffer size changes to try and reduce the #
of times the callback
// is invoked to try and save battery life
//
UInt32 maxFPS = 4096;
OSStatus status;
status = AudioUnitSetProperty(au,
kAudioUnitProperty_MaximumFramesPerSlice,
kAudioUnitScope_Global, 0, &maxFPS, sizeof(maxFPS));
SCIAudioCheckError(status, "AudioUnitSetProperty could not set
kAudioUnitProperty_MaximumFramesPerSlice");
}
Andy
>
_______________________________________________
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