Has anybody had any success with OnPlaybackPositionUpdateListener? I'm successfully playing one-second PCM sound clips with AudioTrack in MODE_STATIC mode (although the playback often appears truncated), but no matter what I do, onMarkerReached() is never called. I set setNotificationMarkerPosition() to a position a bit less than my sample count. I do not have any such problems with its MediaPlayer counterpart setOnCompletionListener(). I simply want onMarkerReached() to run when my AudioTrack instance has finished playing, but the getPlayState() remains PLAYSTATE_PLAYING after my AudioTrack has finished sounding. What might be wrong? What does it take to get AudioTrack to run onMarkerReached() at the end of the data? Any concrete sample code for this that works?
Another strange thing is that at the end of a one second sound at sample rate 16000, getPlaybackHeadPosition() returns 16000 as expected, but for a sample rate of 22050 getPlaybackHeadPosition() becomes consistently 22016, for a sample rate of 11025 getPlaybackHeadPosition() becomes 11008, while for a sample rate of 8000 the getPlaybackHeadPosition() returns consistently 8000 again. Are the discrepancies for sample rates of 11025 and 22050 due to rounding inaccuracies in the AudioTrack sample rate divider? Thanks --~--~---------~--~----~------------~-------~--~----~ 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-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---