Class SoundPlayer

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.cashdrawer.SoundPlayer
All Implemented Interfaces:
Runnable

public class SoundPlayer extends Object implements 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 Details

    • SoundPlayer

      public SoundPlayer(String name)
      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()
      Specified by:
      run in interface Runnable