我想一次播放5个音频,但时间延迟不同。喜欢(a.mp3,时间延迟为2秒,b.mp3 = 4秒等),但我不知道该怎么做。
答案 0 :(得分:4)
您可以使用处理程序。
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);
}