// audioUtils.js import { Howl } from "howler"; const clickSound = new Howl({ src: ["./static/bap.mp3"], // Use relative path html5: true, // Force HTML5 Audio to handle mobile playback better preload: true, // Preload the sound volume: 1.0, format: ["mp3"], onplay: function () { console.log("play"); }, }); export function playClickSound() { console.log("Attempting to play click sound"); // Check if audio is loaded if (clickSound.state() === "loaded") { clickSound.play(); } else { // If not loaded, wait for it to load clickSound.once("load", function () { clickSound.play(); }); } }