pt.citar.diablu.nxt.brick
Class NXTSpeaker
java.lang.Object
pt.citar.diablu.nxt.brick.NXTSpeaker
public class NXTSpeaker
- extends Object
- Author:
- Jorge Cardoso
Constructor Summary |
NXTSpeaker(NXTBrick brick)
Creates a new instance of NXTSpeaker associated with a NXTBrick |
Method Summary |
boolean |
playSoundFile(String filename,
boolean loop)
Plays a sound file. |
boolean |
playTone(int frequency,
int duration)
Plays a tone on the brick. |
NXTSpeaker
public NXTSpeaker(NXTBrick brick)
- Creates a new instance of NXTSpeaker associated with a NXTBrick
- Parameters:
brick
- The NXTBrick instance.
playTone
public boolean playTone(int frequency,
int duration)
- Plays a tone on the brick.
- Parameters:
frequency
- The frequency of the tone.duration
- The duration of the tone.
- Returns:
- True if no error; False on error.
playSoundFile
public boolean playSoundFile(String filename,
boolean loop)
- Plays a sound file.
- Parameters:
filename
- The sound file name.loop
- True: loop the sound file; False: play only once.
- Returns:
- True if no error; False, otherwise.
Processing library NXTComm by Jorge C. S. Cardoso. (c) 2014