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

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -