as.clynx.audio.mux.streams
Class AudioStream

java.lang.Object
  extended by java.io.InputStream
      extended by javax.sound.sampled.AudioInputStream
          extended by as.clynx.audio.mux.streams.AudioStream
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
DistanceStream, MultiStream, SequencedStream

public abstract class AudioStream
extends javax.sound.sampled.AudioInputStream

The abstract class AudioStream.java must be extended by all AudioInputStreams with mixerfunction. it reads all audiofiles and mixes the data in specified way.

Version:
cLynx v.1.2, JDK 6.0: 12.10.2007
Author:
Andreas Senfter - andreas@senfters.com

Field Summary
static int DYNAMIC_MODE
           
static int STATIC_MODE
           
 
Constructor Summary
AudioStream(IAudioFileCollection audiofiles, SettingControl settings)
          Constructor
 
Method Summary
 javax.sound.sampled.AudioFormat getFormat()
          returns the Audio output Format
 int getMode()
          returns the mode of the audiostream instance
 SettingControl getSettings()
          returns the settingcontrol
 javax.sound.sampled.SourceDataLine getSourceDataLine()
          returns the source data line
abstract  int getTargetBufferSize()
          returns the buffersze of the targetBuffer
abstract  int getType()
          returns the type of the mux function
 int read(byte[] targetData, int t_offset, int nLength)
           
 void setDurationInSeconds(float d)
          sets the duration in seconds [can be done in runtime]
 void setFadeTimeInSeconds(float chd)
          sets the crossfade time in seconds [can be done in runtime]
 void setFadeValue(float fade)
          sets the master fade value
 
Methods inherited from class javax.sound.sampled.AudioInputStream
available, close, getFrameLength, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DYNAMIC_MODE

public static int DYNAMIC_MODE

STATIC_MODE

public static int STATIC_MODE
Constructor Detail

AudioStream

public AudioStream(IAudioFileCollection audiofiles,
                   SettingControl settings)
Constructor

Parameters:
audiofiles -
settings -
Method Detail

getFormat

public javax.sound.sampled.AudioFormat getFormat()
returns the Audio output Format

Overrides:
getFormat in class javax.sound.sampled.AudioInputStream

setFadeValue

public void setFadeValue(float fade)
sets the master fade value

Parameters:
fade -

getSourceDataLine

public javax.sound.sampled.SourceDataLine getSourceDataLine()
returns the source data line

Returns:
the source data line

read

public int read(byte[] targetData,
                int t_offset,
                int nLength)
         throws java.io.IOException
Overrides:
read in class javax.sound.sampled.AudioInputStream
Throws:
java.io.IOException

getTargetBufferSize

public abstract int getTargetBufferSize()
returns the buffersze of the targetBuffer

Returns:
the buffersze of the targetBuffer

setDurationInSeconds

public void setDurationInSeconds(float d)
sets the duration in seconds [can be done in runtime]

Parameters:
d -

setFadeTimeInSeconds

public void setFadeTimeInSeconds(float chd)
sets the crossfade time in seconds [can be done in runtime]

Parameters:
chd -

getMode

public int getMode()
returns the mode of the audiostream instance

Returns:
the mode of the audiostream instance

getType

public abstract int getType()
returns the type of the mux function

Returns:
the type of the mux function

getSettings

public SettingControl getSettings()
returns the settingcontrol

Returns:
the settingcontrol