开发者

Doing an audio loop on Android

开发者 https://www.devze.com 2022-12-28 04:34 出处:网络
I have a track I want to play \'megadeth\', I\'m calling it by: final MediaPlay开发者_C百科er mp = MediaPlayer.create(this, R.raw.megadeth);

I have a track I want to play 'megadeth', I'm calling it by:

    final MediaPlay开发者_C百科er mp = MediaPlayer.create(this, R.raw.megadeth);

And playing it by using 'mp.start'.

And I just want to know, how can I get this audio mp3 to loop?


Before adding

mp.start();

Add

MediaPlayer mp = MediaPlayer.create(MainMenu.this, R.raw.megadeth);
    mp.setLooping(true);

the mp.setLooping(true); automatically allows the raw file to be used over and over again.

0

精彩评论

暂无评论...
验证码 换一张
取 消