Class ThincSMsgSoundPlay

java.lang.Object
  extended by ThincMsg
      extended by ThincSMsg
          extended by ThincSMsgSound
              extended by ThincSMsgSoundPlay

public final class ThincSMsgSoundPlay
extends ThincSMsgSound

class for creating and getting sound stream.

Author:
Young Jin Yoon
See Also:
ThincSMsgSound

Field Summary
static int MESSAGE_SIZE
           
static int MESSAGE_TYPE
           
 
Fields inherited from class ThincSMsgSound
ENCODING, format, FRAME_RATE, playInfo, SAMPLE_SIZE, streamId
 
Fields inherited from class ThincMsg
canvas, handler
 
Constructor Summary
ThincSMsgSoundPlay(ThincSoundHandler h)
          creates ThincSMsgSoundPlay object.
 
Method Summary
private  void playSound(javax.sound.sampled.SourceDataLine src, int size, int timestamp)
          playSound() play the sound by using write method from SourceDataLine object.
 void process()
          process() get the stream from the server and try to play it. if it is the first stream from the server, save the information for stream in the hash table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_TYPE

public static final int MESSAGE_TYPE
See Also:
Constant Field Values

MESSAGE_SIZE

public static final int MESSAGE_SIZE
See Also:
Constant Field Values
Constructor Detail

ThincSMsgSoundPlay

public ThincSMsgSoundPlay(ThincSoundHandler h)
creates ThincSMsgSoundPlay object.

Parameters:
h - ThincSoundHandler to handle the message
Method Detail

process

public void process()
             throws ThincException
process() get the stream from the server and try to play it. if it is the first stream from the server, save the information for stream in the hash table.

Specified by:
process in class ThincMsg
Throws:
ThincException

playSound

private void playSound(javax.sound.sampled.SourceDataLine src,
                       int size,
                       int timestamp)
                throws ThincException
playSound() play the sound by using write method from SourceDataLine object.

Throws:
ThincException