icommand.nxt
Class Sound

java.lang.Object
  extended by icommand.nxt.Sound

public class Sound
extends java.lang.Object

Sound class. Usage: SoundSensor.playTone(500, 1000);

Version:
0.1 10-August-2006
Author:
Brian Bagnall

Method Summary
static byte playSoundFile(java.lang.String fileName)
          Plays a sound file once from the NXT.
static byte playSoundFile(java.lang.String fileName, boolean repeat)
          Plays a sound file from the NXT.
static int playTone(int frequency, int duration)
           
static int stopSoundPlayback()
          Stops a sound file that has been playing/repeating.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

playTone

public static int playTone(int frequency,
                           int duration)

playSoundFile

public static byte playSoundFile(java.lang.String fileName,
                                 boolean repeat)
Plays a sound file from the NXT. SoundSensor files use the .rso extension. The filename is not case sensitive. Filenames on the NXT Bricks display do now show the filename extension.

Parameters:
fileName - e.g. "Woops.rso"
repeat - true = repeat, false = play once.
Returns:
If you receive a non-zero number, the filename is probably wrong or the file is not uploaded to the NXT brick.

playSoundFile

public static byte playSoundFile(java.lang.String fileName)
Plays a sound file once from the NXT. SoundSensor files use the .rso extension. The filename is not case sensitive. Filenames on the NXT Bricks display do now show the filename extension.

Parameters:
fileName - e.g. "Woops.rso"
Returns:
If you receive a non-zero number, the filename is probably wrong or the file is not uploaded to the NXT brick.

stopSoundPlayback

public static int stopSoundPlayback()
Stops a sound file that has been playing/repeating.

Returns:
Error code.


Copyright © 2006. All Rights Reserved.