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

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -

python - PyInstaller UAC not working in onefile mode -

wso2is - WSO2 IS 5.0.0 SP1 After restart there is authentication error -