User:Lancelot Chen

// get all the audio elements on the page const audioElements = document.querySelectorAll('audio'); // add event listeners to each audio element audioElements.forEach(audio => { // listen for the "ended" event  audio.addEventListener('ended',  => {    // apply the fade-out effect    audio.style.transition = 'volume 0.5s';    audio.volume = 0;        // stop the old audio element and start the new one    const newAudio = new Audio('path/to/new/audio.mp3');    newAudio.play;  }); });