java - Android How to Loop MediaPlayer between Specified bounds -
i'm trying loop section of audio file. suppose audio file's duration 2:00 minutes. set start , end bounds need loop. example start bound 01:05 , end bound 01:45. want loop mediaplayer between these 30 seconds.
here's code :
mediaplayer mp = null; mp.setaudiostreamtype(audiomanager.stream_music); mp.setlooping(true); mp.setdatasource(getapplicationcontext(),"audio file path"); int start = 65*1000; int end = 95*1000; mp.start(); mp.seekto(start);
i'm able start mediplayer @ start position, don't know how stop in middle , again loop same start position , end @ end position.
Comments
Post a Comment