Thursday, March 31, 2011

[android-developers] Re: What exactly is the obtainBuffer in an AudioTrack?

I've tinkered a bit more, optimized some of the code that was
optimizable (enhanced for loops instead of hard coded for loops, use
System.arrayCopy to copy arrays instead of hard coded array copy's),
and I've found that another problem I had got solved. But besides
that, this issue still stands. The delay I have when playing Audio
still remains and I still haven't found a solution regarding the
obtainBuffer warning... ¬¬

On 25 mrt, 11:11, ThaMe90 <theprophes...@gmail.com> wrote:
> Could anyone share their insights on this one?
>
> On 22 mrt, 13:00, ThaMe90 <theprophes...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On a side note, I am developing for Android 2.2 minimum. And I use a
> > real device to test everything. I've stopped using the Emulator for
> > sound related topics, as I never got the sound working in the Emulator
> > at all...
> > See a previous post on this:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > On 22 mrt, 12:56, ThaMe90 <theprophes...@gmail.com> wrote:
>
> > > Hmm, I'd rather solve it, as it is the only viable explanation left
> > > for why I have delays in playing...
> > > As I've said in my first post, I've tried playing with the buffersize
> > > of the AudioTrack, but to no avail.
> > > The only lead to a solution I have atm. is the warning, so I can't
> > > ignore it...
>
> > > On 22 mrt, 12:30, emymrin <emym...@gmail.com> wrote:
>
> > > > > how can I prevent (or at least minimize) the delay
>
> > > > When AudioTrack object is created, buffer size is passed into a
> > > > constructor among other parameters.
> > > > AudioTrack won't start playing until you write at least that amount of
> > > > data into it.
> > > > I presume that in your case chosen buffer size is siginificantly
> > > > larger than AudioTrack.getMinBufferSize.
> > > > That's why it doesn't start playing when the first data portion is
> > > > written.
>
> > > > > famous obtainBuffer timed out (is the CPU pegged?) warning
>
> > > > It appears to the worst in 1.5 emulator.
> > > > Much better in Android 2+ emulator (shown maybe once per 4 seconds).
> > > > I have never seen this warning when testing on a real device.
> > > > My suggestion is to ignore it.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment