samedi 20 décembre 2014

how to play sound looping without gap in android

I want to play a "wav" file of 1 seconds multiple times without gap. All my attemps failed. My existing code is as follows;



MediaPlayer mMediaPlayer = MediaPlayer.create(this, R.raw.my5s);
MediaPlayer mMediaPlayer2 = MediaPlayer.create(this, R.raw.my5s);
mMediaPlayer.setVolume(1, 1);
mMediaPlayer.setLooping(true);
this.mMediaPlayer.setNextMediaPlayer(mMediaPlayer2);

this.mMediaPlayer.start();


I also tried the solutions in the following links;



  1. play .ogg file

  2. manual looping


Aucun commentaire:

Enregistrer un commentaire