// https://sfxr.me/
// https://github.com/chr15m/jsfxr?tab=readme-ov-file#library
// https://github.com/goldfire/howler.js

import { sfxr } from "jsfxr";
import { Howl } from "howler";

export const coinSound = () => {
  const coin = sfxr.toAudio(
    "34T6PkpUzHPSs4CvSaNXpQ6fftpW1yrCDSda6oECJ5CH6BEaokmoZC7aAra2xef61iP6srxUaRZUk8Z2DRJHNMEvtWCLjgKkUCFtpxPe9o8AvYBCJZG1YNNPR"
  );
  coin.play();
};

export const errorSound = () => {
  const fail = sfxr.toAudio(
    "3mLuemG9nym33ak7ot6gTcNTFBBnNkcF4rmQFkh1zRhrvJ6totmE1EX61m9LTW9KWGuQpQEMqnVopubShwmxqQK7vAZYMXKbJCxYE9bcTh2qMm9JbMRJAKD5a"
  );
  fail.play();
};

export const clickSound = () => {
  const click = sfxr.toAudio(
    "7BMHBGPkXasqBZ54qHeMQTKSwDs2Y176H4hQVNkvQPg5eZyckEhyzKTnAZfqnp9ayL5iPVRNXFNjXAXBbUKhT7U6c1hKZBgWzaWkWTQvmcrCwikKi3RoF7wbd"
  );
  click.play();
};

export const lostSound = () => {
  const fail = new Howl({
    src: ["/sounds/lost.wav"],
  });

  fail.play();
};

export const wonSound = () => {
  const won = new Howl({
    src: ["/sounds/arcade_win.wav"],
  });

  won.play();
};
