Public Domain Song Generator

Use this generator to generate a song that is Public Domain

Random Audio Picker

Random Audio Picker


// List of audio files
const audioList = [
    'audio1.mp3',
    'audio2.mp3',
    'audio3.mp3',
    'audio4.mp3',
    'audio5.mp3'
];

// Function to pick and play a random audio file
function playRandomAudio() {
    // Pick a random audio file from the list
    const randomIndex = Math.floor(Math.random() * audioList.length);
    const selectedAudio = audioList[randomIndex];

    // Get the audio player and source elements
    const audioPlayer = document.getElementById('audioPlayer');
    const audioSource = document.getElementById('audioSource');

    // Update the audio source and play
    audioSource.src = selectedAudio;
    audioPlayer.load();
    audioPlayer.play();
}