WIMM Labs


com.wimm.framework.os
Class Beeper

java.lang.Object
  extended by com.wimm.framework.os.Beeper

public final class Beeper
extends Object

Classes for working with piezo speaker (beeper).


Nested Class Summary
static class Beeper.Beep
          Describes a single beep.
static class Beeper.Sequence
          Describes a sequence of beeps and breaks (pauses).
 
Constructor Summary
Beeper(Context context)
          Default constructor.
 
Method Summary
 void beep()
          Beeps the piezo using the default duration and pitch.
 void beep(Beeper.Beep beep)
          Beeps the piezo using the provided Beeper.Beep.
 void beep(Beeper.Sequence beepSequence)
          Beeps the piezo using the provided Beeper.Sequence.
 void beep(int duration)
          Beeps the piezo using the provided duration and the default pitch.
 void beep(int duration, int pitch)
          Beeps the piezo using the provided duration and pitch.
 void cancel()
          Stops the current beep sequence.
 boolean hasBeeper()
          Checks whether the hardware has a piezo speaker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Beeper

public Beeper(Context context)
Default constructor.

Since:
WIMM SDK 1.0.3
Method Detail

hasBeeper

public boolean hasBeeper()
Checks whether the hardware has a piezo speaker.

Returns:
true if a piezo speaker is present, otherwise false.
Since:
WIMM SDK 1.0.3

beep

public void beep()
Beeps the piezo using the default duration and pitch.

Since:
WIMM SDK 1.0.3

beep

public void beep(int duration)
Beeps the piezo using the provided duration and the default pitch.

Parameters:
duration - The length of the beep in milliseconds. Values range from 0 to 5000.
Since:
WIMM SDK 1.0.3

beep

public void beep(int duration,
                 int pitch)
Beeps the piezo using the provided duration and pitch.

Parameters:
duration - The length of the beep in milliseconds. Values range from 0 to 5000.
pitch - The tone of the beep. Values range from 0 to 255. Low=0, High=255.
Since:
WIMM SDK 1.0.3

beep

public void beep(Beeper.Beep beep)
Beeps the piezo using the provided Beeper.Beep.

Parameters:
beep - The Beeper.Beep.
Since:
WIMM SDK 1.0.3

beep

public void beep(Beeper.Sequence beepSequence)
Beeps the piezo using the provided Beeper.Sequence.

Parameters:
beepSequence - The Beeper.Sequence.
Since:
WIMM SDK 1.0.3

cancel

public void cancel()
Stops the current beep sequence.

Since:
WIMM SDK 1.0.3

WIMM Labs