codesimian
Class AllSound

java.lang.Object
  extended by java.lang.Thread
      extended by codesimian.AllSound
All Implemented Interfaces:
java.lang.Runnable

public class AllSound
extends java.lang.Thread


Nested Class Summary
static interface AllSound.ByteMaker
          Provides the bytes to be played through audio output.
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static byte[] doubleToByte(double[] soundData, int bytesPerDouble)
          double range is -1 to 1.
static void play(AllSound.ByteMaker playMeContinuously)
          plays until playMeContinuously.getBytes() returns null
static void play(byte[] playTheseBytes)
          interruptes a ByteMaker if its playing, but will wait on other byte arrays to play
static void play(double[] convertToBytesThenPlay)
          similar to play(byte[])
static void r(javax.sound.sampled.AudioFormat f)
          I removed this stuff from run() so I could call it from other places
static void removeByteMaker()
           
 void run()
          Thread
static void startIfNotStarted()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

play

public static void play(AllSound.ByteMaker playMeContinuously)
plays until playMeContinuously.getBytes() returns null


removeByteMaker

public static void removeByteMaker()

play

public static void play(byte[] playTheseBytes)
interruptes a ByteMaker if its playing, but will wait on other byte arrays to play


play

public static void play(double[] convertToBytesThenPlay)
similar to play(byte[])


doubleToByte

public static byte[] doubleToByte(double[] soundData,
                                  int bytesPerDouble)
double range is -1 to 1. Most features of AudioFormat are not used.


run

public void run()
Thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

r

public static void r(javax.sound.sampled.AudioFormat f)
I removed this stuff from run() so I could call it from other places


startIfNotStarted

public static void startIfNotStarted()