'use client';

export const Sounds = {
  alternative: new Audio("/sfx/s_alternative.mp3"),
  busy: new Audio("/sfx/s_busy.mp3"),
  happy: new Audio("/sfx/s_happy.mp3"),
  hover: new Audio("/sfx/s_hover.mp3"),
  impossible: new Audio("/sfx/s_impossible.mp3"),
  notice: new Audio("/sfx/s_notice.mp3"),
  open: new Audio("/sfx/s_open.mp3"),
  possible_alt: new Audio("/sfx/s_possible_alt.mp3"),
  sad: new Audio("/sfx/s_sad.mp3"),
};

export function preload() {
  Object.values(Sounds).forEach((sound) => {
    sound.preload = "auto";
  })
}

export function playSound(audio:HTMLAudioElement) {
  audio.currentTime = 0;
  audio.play();
}