How in android we can play audio one after another? -


sorry english. i'm writting android background service app. app electronic voice queue in bank. need play audio files 1 one in right order. example create container audio-files names example:

         string music_names[] = {one.wav, two.wav, three.wav, four.wav, five.wav}; 

how can play files raw directory example, or other place? how can play in right order 1 one delay 1 second?

you have set oncompletionlistener each , start next 1 on completion.

    mediaplayer.setoncompletionlistener(new mediaplayer.oncompletionlistener()      {         @override         public void oncompletion(mediaplayer mp)          {              // code start next audio in sequence         }     }); 

the best way achieve create class implements oncompletionlistener handles oncompletion , receives next file play. way can instantiate nicely in code. of course, don't forget break; in cases above.

thanks


Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -