com.cloudgarden.audio
Class DefaultAudioConverter

java.lang.Object
  |
  +--com.cloudgarden.audio.DefaultAudioObject
        |
        +--com.cloudgarden.audio.DefaultAudioSource
              |
              +--com.cloudgarden.audio.DefaultAudioConnector
                    |
                    +--com.cloudgarden.audio.DefaultAudioConverter
All Implemented Interfaces:
AudioConnector, AudioConverter, AudioObject, AudioSink, AudioSource
Direct Known Subclasses:
AudioFormatConverter, AudioMediaFormatConverter

public abstract class DefaultAudioConverter
extends DefaultAudioConnector
implements AudioConverter


Field Summary
protected  java.lang.String srcContentType
           
protected  javax.sound.sampled.AudioFormat srcFmt
           
 
Fields inherited from class com.cloudgarden.audio.DefaultAudioConnector
source
 
Fields inherited from class com.cloudgarden.audio.DefaultAudioSource
sending, sendThread, sink
 
Fields inherited from class com.cloudgarden.audio.DefaultAudioObject
contentType, exception, format, listeners, paused, pauseSync, running, waiting
 
Fields inherited from interface com.cloudgarden.audio.AudioObject
END_OF_DATA
 
Constructor Summary
DefaultAudioConverter()
           
 
Method Summary
 javax.sound.sampled.AudioFormat getIncomingAudioFormat()
           
 java.lang.String getIncomingContentType()
           
 void setIncomingAudioFormat(javax.sound.sampled.AudioFormat format)
           
 void setIncomingContentType(java.lang.String contentType)
           
 void setSource(AudioSource src)
          Sets the source for this sink - this method should also call the setSink method on the source object (while avoiding an endless loop) to ensure that sink and source are connected to each other (and not to different sinks/sources).
 
Methods inherited from class com.cloudgarden.audio.DefaultAudioConnector
getSource, write
 
Methods inherited from class com.cloudgarden.audio.DefaultAudioSource
drain, getSink, isSending, read, setAudioFormat, setBufferSize, setContentType, setSink, startSending, stopSending
 
Methods inherited from class com.cloudgarden.audio.DefaultAudioObject
addTransferListener, blockWhilePaused, blockWhileWaiting, bytesTransferred, canSetAudioFormat, getAudioFormat, getContentType, getLastException, isPaused, isWaiting, removeTransferListener, setPaused
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cloudgarden.audio.AudioSource
getSink, isSending, read, read, setSink, startSending, stopSending
 
Methods inherited from interface com.cloudgarden.audio.AudioObject
addTransferListener, canSetAudioFormat, drain, getAudioFormat, getContentType, isPaused, isWaiting, removeTransferListener, setAudioFormat, setContentType, setPaused
 
Methods inherited from interface com.cloudgarden.audio.AudioSink
getSource, write, write
 

Field Detail

srcFmt

protected javax.sound.sampled.AudioFormat srcFmt

srcContentType

protected java.lang.String srcContentType
Constructor Detail

DefaultAudioConverter

public DefaultAudioConverter()
Method Detail

setSource

public void setSource(AudioSource src)
               throws java.io.IOException
Description copied from interface: AudioSink
Sets the source for this sink - this method should also call the setSink method on the source object (while avoiding an endless loop) to ensure that sink and source are connected to each other (and not to different sinks/sources). Also ensures continuity of the AudioFormat and ContentType (as described below).

If the source's AudioFormat is null or the source's format differs from this AudioSink's format, then the source's format is set equal to that of this AudioSink.

If the source's AudioFormat is not null and this AudioSink's format is null then this AudioSink's format is set equal to the source's.

The same is done for the ContentType as described above for the AudioFormat.

Specified by:
setSource in interface AudioSink
Overrides:
setSource in class DefaultAudioConnector
Following copied from interface: com.cloudgarden.audio.AudioSink
See Also:
AudioSink.getSource()

getIncomingAudioFormat

public javax.sound.sampled.AudioFormat getIncomingAudioFormat()
Specified by:
getIncomingAudioFormat in interface AudioConverter

getIncomingContentType

public java.lang.String getIncomingContentType()
Specified by:
getIncomingContentType in interface AudioConverter

setIncomingAudioFormat

public void setIncomingAudioFormat(javax.sound.sampled.AudioFormat format)
                            throws java.io.IOException
Specified by:
setIncomingAudioFormat in interface AudioConverter

setIncomingContentType

public void setIncomingContentType(java.lang.String contentType)
Specified by:
setIncomingContentType in interface AudioConverter