Re: Changing buffer size on iOS when app is in background
Re: Changing buffer size on iOS when app is in background
- Subject: Re: Changing buffer size on iOS when app is in background
- From: Daniel Blezek <email@hidden>
- Date: Fri, 11 Feb 2011 21:48:57 -0600
Thanks for the pointers. I was able to solve this by requesting a fixed size playback buffer at app startup. Interestingly if I requested a 20ms buffer, the stutter was better but not gone. 30ms did the trick, and is acceptable for my app. The code looks like this:
NSError *setPreferenceError = nil;
NSTimeInterval preferredBufferDuration = 0.030;
[[AVAudioSession sharedInstance] setPreferredIOBufferDuration: preferredBufferDuration
error: &setPreferenceError];
Best regards,
-dan
On Feb 11, 2011, at 2:21 PM, Roni Music wrote:
> Try Google
> QA1606
>
>
>> Message: 5
>> Date: Fri, 11 Feb 2011 12:27:56 -0500
>> From: Steve Bird <email@hidden>
>> Subject: Re: Changing buffer size on iOS when app is in background
>> To: Daniel Blezek <email@hidden>
>> Cc: CoreAudio API <email@hidden>
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset=us-ascii
>>
>>
>> On Feb 11, 2011, at 12:14 PM, Daniel Blezek wrote:
>>
>>> Hi all,
>>>
>>> My sound is fine while the app is in the background,
>>
>> --- that seems to conflict with this:
>>
>>
>>> iOS increases the buffer size when
>>> an app goes to the background, presumably to increase battery life.
>>> My app doesn't catch this, and continues filling up only part of the
>>> buffer, so my audio is choppy and sounds stretched.
>>
>> --- if the change occurs when the app moves TO the background, then it would seem like the problem would start then, as well.
>>
>>
>> ----------------------------------------------------------------
>> Steve Bird
>> Culverson Software - Elegant software that is a pleasure to use.
>> www.Culverson.com (toll free) 1-877-676-8175
>>
>>
>>
>
--
Daniel Blezek
email@hidden
_______________________________________________
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