Package com.company
Class Son
java.lang.Object
com.company.Son
public class Son
extends java.lang.Object
Un son qui peut être joué
-
Field Summary
Fields Modifier and Type Field Description private javax.sound.sampled.Clipclip -
Constructor Summary
Constructors Constructor Description Son(java.lang.String soundName) -
Method Summary
Modifier and Type Method Description voidjouer()Jouer le son un foisvoidjouerEnBoucle()Jouer le son en bouclevoidstop()Stopper le sonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
clip
private javax.sound.sampled.Clip clip
-
-
Constructor Details
-
Son
public Son(java.lang.String soundName)- Parameters:
soundName- Le nom du fichier sonore à jouer. Doit être placer dans le dossier resources et être au format .wav
-
-
Method Details
-
jouer
public void jouer()Jouer le son un fois -
jouerEnBoucle
public void jouerEnBoucle()Jouer le son en boucle -
stop
public void stop()Stopper le son
-