On May 1, 6:43 pm, Jean-Michel <[email protected]> wrote:
> Blindfold,
Yes, with the marker set at 1000 I would now *sometimes* get the
onMarkerReached() callback, but extremely rarely (maybe once in a
hundred one-second 8-bit mono PCM sample playbacks on my ADP, which is
why I had not even noticed it at first). It may depend on parameter
settings, sample length, CPU load, whatever, but for my use it is
totally unreliable and useless. At least it proves that my coding was
not totally wrong, or else the callback would *never* have been
invoked. :-)

I think we need some feedback from the Android Team about how
onMarkerReached() is supposed to behave or under what conditions it
works. Some undocumented statement order that one has to adhere to?
Timing assumptions? By contrast, MediaPlayer's OnCompletionListener()
works just fine for me.

Thanks

> I can get onMarkerReached() called for a STATICAudioTrackinstance. A
> few things you might want to try:
> - the marker position must be set in frames, not bytes. So make sure
> you're not giving a marker position that's not beyond your content.
> For instance if your content is stereo/8bit, you must divide the size
> by two, by four for stereo/16bit, to go from data size to frame count.
> - try setting a really low value for your marker position, like 10, to
> see if it gets called.
> - if all that still doesn't work, I'd start checking in which thread
> the callback is supposed to be called. By default it's in the same
> thread as the one in which you created yourAudioTrackinstance. If
> you want it to be called from a different thread, use
> setPlaybackPositionUpdateListener(listener, handler) where you pass
> the handler of the thread you want to use.
> Hope this helps.

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

Reply via email to