wiiremotej
Class PrebufferedSound

java.lang.Object
  extended by wiiremotej.PrebufferedSound

public class PrebufferedSound
extends java.lang.Object

Takes the given array of sound data and packages it into ready-made reports that can be sent immediately via sendCommand. Timing is still important, though, so make sure to use this with a playPrebufferedSound method. PrebufferedSounds are immutable.


Constructor Summary
PrebufferedSound(byte[][] soundData, int sampleRate, int sampleSize)
          Creates a new prebuffered sound with the given data array.
 
Method Summary
 byte[] getReport(int num)
          Returns the specified prepackaged sound data report.
 int getSampleRate()
          Returns the sample rate of the sound data should be played at.
 int getSampleSize()
          Returns the size of a sample in bits.
 int numReports()
          Returns the number of prepackaged sound data reports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrebufferedSound

public PrebufferedSound(byte[][] soundData,
                        int sampleRate,
                        int sampleSize)
Creates a new prebuffered sound with the given data array.

Parameters:
soundData - the sound data, already pre-packaged in ready-to-go reports.
sampleRate - the sample rate of the sound in Hz.
sampleSize - the size of a sample (in bits).
Method Detail

getReport

public byte[] getReport(int num)
Returns the specified prepackaged sound data report.

Returns:
the specified prepackaged sound data report.

numReports

public int numReports()
Returns the number of prepackaged sound data reports.

Returns:
the number of prepackaged sound data reports.

getSampleRate

public int getSampleRate()
Returns the sample rate of the sound data should be played at.

Returns:
the sample rate of the sound data should be played at.

getSampleSize

public int getSampleSize()
Returns the size of a sample in bits.

Returns:
the size of a sample in bits.