soundFiles.push(loadSound("1.mp3"));
soundFiles.push(loadSound("2.mp3"));
soundFiles.push(loadSound("3.mp3"));
uploadedImage = loadImage("21.jpg");
backgroundColor = color(50, 50, 70);
volumeSlider = createSlider(0, 1, 0.5, 0.01);
volumeSlider.position(20, height - 40);
volumeSlider.style("width", "150px");
buttons.push(createButton("Play Sound 1"));
buttons.push(createButton("Play Sound 2"));
buttons.push(createButton("Play Sound 3"));
for (let i = 0; i < buttons.length; i++) {
buttons[i].position(20, 20 + i * 40);
buttons[i].mousePressed(() => playSound(i));
buttons[i].style("font-size", "16px");
buttons[i].style("background-color", "#007BFF");
buttons[i].style("color", "#FFF");
buttons[i].style("border", "none");
buttons[i].style("padding", "10px 20px");
buttons[i].style("cursor", "pointer");
background(backgroundColor);
if (currentSound && currentSound.isPlaying()) {
currentSound.setVolume(volumeSlider.value());
let x = map(mouseX, 0, width, 0, 255);
let y = map(mouseY, 0, height, 0, 255);
ellipse(width / 2, height / 2, 200, 200);
image(uploadedImage, imageX, height / 2, 300, 300);
if (imageX > width || imageX < 0) {
text("Adjust Volume:", 20, height - 50);
function playSound(index) {
currentSound = soundFiles[index];