This repository has been archived by the owner on Jul 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSound.java
27 lines (24 loc) · 1.68 KB
/
Sound.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package ATMjavafx;
import javafx.scene.media.AudioClip;
import static javafx.scene.media.AudioClip.INDEFINITE;
/*
Load sound files From library
*/
public class Sound {
public static AudioClip button = new AudioClip( Sound.class.getResource("lib/buttonPressed.wav").toExternalForm());
public static AudioClip correct = new AudioClip( Sound.class.getResource("lib/correct.mp3").toExternalForm());
public static AudioClip error = new AudioClip( Sound.class.getResource("lib/error.wav").toExternalForm());
public static AudioClip bigError = new AudioClip( Sound.class.getResource("lib/BigError.wav").toExternalForm());
public static AudioClip kidsLaughter = new AudioClip( Sound.class.getResource("lib/kidsLaughter.wav").toExternalForm());
public static AudioClip boo = new AudioClip( Sound.class.getResource("lib/boo.wav").toExternalForm());
public static AudioClip gameOver = new AudioClip( Sound.class.getResource("lib/gameOver.mp3").toExternalForm());
public static AudioClip printer = new AudioClip( Sound.class.getResource("lib/printer.wav").toExternalForm());
public static AudioClip coinsOut = new AudioClip( Sound.class.getResource("lib/coinsOut.wav").toExternalForm());
public static AudioClip cashOut = new AudioClip( Sound.class.getResource("lib/cashOut.wav").toExternalForm());
public static AudioClip pleaseEnterYourPassword = new AudioClip( Sound.class.getResource("lib/pleaseEnterYourPassword.wav").toExternalForm());
public static AudioClip background = new AudioClip( Sound.class.getResource("lib/background.wav").toExternalForm());
public static void playBackgoundSound(){
background.setCycleCount(INDEFINITE);
background.stop(); background.play();
}
}