android - trigger function when sound reach certain position -


i want play sound either using mediaplayer or sound pool. , want when sound/music reach position such

function void hello(){ // reach position 1.5 seconds }    mediaplayer.setoncertainposition(1500, hello()); // not actual code 

currently found create loop function every xxx millisecond ,

mediaplayer.getcurrentposition() 

from this answer

is there better code?
note: found audiotrack not sure how works , how use it


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -