MediaPlayer 播放声音大小设置
1、privateMediaPlayermp;@OverrideprotectedvoidonCreate(BundlesavedInst锾攒揉敫anceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);mp=MediaPlayer.create(this,R.raw.xjwq);mp.start();mp.setLooping(true);}

3、@Overrideprotecte蟠校盯昂dvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);mp1=MediaPlayer.create(this,R.raw.xjwq);mp2=MediaPlayer.create(this,R.raw.bg);mp3=MediaPlayer.create(this,R.raw.xghzj);mp1.start();mp1.setLooping(true);}

5、mpIndex++;if(mpIndex==3)mpIndex=0;if(mpIndex==0){ mp1.start();mp1.setLooping(true);elseif(mpIndex==1){ mp2.start();mp2.setLooping(true) else{mp3.start();mp3.setLooping(true);}

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:26
阅读量:88
阅读量:95
阅读量:88
阅读量:22