📜  播放 mp3 android java 代码示例

📅  最后修改于: 2022-03-11 14:52:36.758000             🧑  作者: Mango

代码示例1
MediaPlayer mediaPlayer;
//In the onCreate Method
mediaPlayer = MediaPlayer.create(this, R.raw.alarmclockbuzzer);
//Sound file goes in "raw" folder in "res" folder
mediaPlayer.start(); //plays the mp3 sound (doesn't need to be in oncreate)