我是2 mp3文件
audio_a.mp3
audio_b.mp3
我想在一个mp3文件中加入两个mp3。之后加入两个文件,首先播放audio_a.mp3,然后播放audio_b.mp3。
我如何在php上完成它?
最佳答案
您无法在PHP中进行操作,而在Javascript中则可能进行操作。.使用javascript onended
事件来触发另一个事件。
<!DOCTYPE html>
<html>
<body>
Song will be started automatically....
<audio id="song1" autoplay>
<source src="https://freemusicdownloads.world/wp-content/uploads/2017/05/Justin-Bieber-Sorry-PURPOSE-The-Movement.mp3" type="audio/mpeg">
</audio>
<audio id="song2">
<source src="https://freemusicdownloads.world/wp-content/uploads/2017/05/Justin-Bieber-Love-Yourself-PURPOSE-The-Movement.mp3" type="audio/mpeg">
</audio>
<script>
var aud = document.getElementById("song1");
aud.onended = function() {
document.getElementById("song2").play();
};
</script>
</body>
</html>
关于php - 结束后如何加入2个mp3文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53814694/