Package mazealgo.view
Class SoundPlayer
java.lang.Object
mazealgo.view.SoundPlayer
Audio playback. Two channels:
- Background music — JavaFX
MediaPlayer, loaded from/mazealgo/view/sounds/background.mp3if present; silently no-op otherwise. Drop a licensed file in and it just starts working. - Victory chime — if
victory.wavships in the same directory it's used; otherwise a short C-E-G-C arpeggio is synthesized in code viajavax.sound.sampledso the feature works out of the box with no third-party assets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidPlays the victory sound.void
-
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.
-