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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -