Class SoundPlayer
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.cashdrawer.SoundPlayer
- All Implemented Interfaces:
Runnable
This class can be used to play a sound on the till if till hardware supports playing sound.
It can be used to generate sounds in WaitForDrawerClose methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Stops sound if sound is playing.voidrun()voidstartSound(int frequency, int duration, int volume)Starts the sound and plays it once in the background.voidWaits until sound has been finished.
-
Constructor Details
-
SoundPlayer
Generates object for playing a sound.- Parameters:
name- Name of the locical device that uses this object.
-
-
Method Details
-
startSound
public void startSound(int frequency, int duration, int volume)Starts the sound and plays it once in the background.- Parameters:
frequency- Frequency of the sound to be played, in Hertz.duration- Duration of the tone in milliseconds.volume- Volume, a value between 0 (silent) and 127 (loud).
-
clear
public void clear()Stops sound if sound is playing. Otherwise nothing will happen. -
waitFinished
public void waitFinished()Waits until sound has been finished. -
run
public void run()
-