我想一次播放5个音频,但有不同的时间延迟。比如(A.MP3延时2秒,B.MP3=4秒等等),但我不知道怎么做。
最佳答案
您可以使用handler。
Handler handler = new Handler();
final static int DELAY = 1000; // one second
public void playAudioWithDelay(){
handler.postDelayed(new Runnable(){
//your code start with delay in one second after calling this method
}, DELAY);
handler.postDelayed(new Runnable(){
//your code start with delay in two seconds after calling this method
}, DELAY * 2);
}
关于android - 使用Android MediaPlayer播放音频之前添加延迟,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39809690/