Package mazealgo.view

Class SoundPlayer

java.lang.Object
mazealgo.view.SoundPlayer

public class SoundPlayer extends Object
Audio playback. Two channels:
  • Background music — JavaFX MediaPlayer, loaded from /mazealgo/view/sounds/background.mp3 if present; silently no-op otherwise. Drop a licensed file in and it just starts working.
  • Victory chime — if victory.wav ships in the same directory it's used; otherwise a short C-E-G-C arpeggio is synthesized in code via javax.sound.sampled so the feature works out of the box with no third-party assets.
  • Constructor Details

    • SoundPlayer

      public SoundPlayer()
  • Method Details

    • playBackground

      public void playBackground()
    • stopBackground

      public void stopBackground()
    • playVictory

      public void playVictory()
      Plays the victory sound. Uses the bundled clip if one was found at startup, otherwise synthesizes a short ascending arpeggio. Runs on a background thread either way — never blocks the FX application thread.