org.tritonus.sampled.convert
Class UlawFormatConversionProvider.FromUlawStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjavax.sound.sampled.AudioInputStream
          extended byorg.tritonus.share.sampled.convert.TAudioInputStream
              extended byorg.tritonus.share.sampled.convert.TSynchronousFilteredAudioInputStream
                  extended byorg.tritonus.sampled.convert.UlawFormatConversionProvider.FromUlawStream
All Implemented Interfaces:
Closeable
Enclosing class:
UlawFormatConversionProvider

class UlawFormatConversionProvider.FromUlawStream
extends TSynchronousFilteredAudioInputStream


Field Summary
 
Fields inherited from class org.tritonus.share.sampled.convert.TSynchronousFilteredAudioInputStream
buffer
 
Fields inherited from class javax.sound.sampled.AudioInputStream
format, frameLength, framePos, frameSize, stream
 
Constructor Summary
UlawFormatConversionProvider.FromUlawStream(AudioInputStream sourceStream, AudioFormat targetFormat)
           
 
Method Summary
protected  int convert(byte[] inBuffer, byte[] outBuffer, int outByteOffset, int inFrameCount)
          Override this method to do the actual conversion.
protected  void convertInPlace(byte[] buffer, int byteOffset, int frameCount)
          Override this method to provide in-place conversion of samples.
 
Methods inherited from class org.tritonus.share.sampled.convert.TSynchronousFilteredAudioInputStream
available, close, enableConvertInPlace, getOriginalFormat, getOriginalStream, mark, markSupported, read, read, reset, skip
 
Methods inherited from class org.tritonus.share.sampled.convert.TAudioInputStream
properties, setProperty
 
Methods inherited from class javax.sound.sampled.AudioInputStream
getFormat, getFrameLength, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UlawFormatConversionProvider.FromUlawStream

public UlawFormatConversionProvider.FromUlawStream(AudioInputStream sourceStream,
                                                   AudioFormat targetFormat)
Method Detail

convert

protected int convert(byte[] inBuffer,
                      byte[] outBuffer,
                      int outByteOffset,
                      int inFrameCount)
Description copied from class: TSynchronousFilteredAudioInputStream
Override this method to do the actual conversion. inBuffer starts always at index 0 (it is an internal buffer) You should always override this. inFrameCount is the number of frames in inBuffer. These frames are of the format originalFormat.

Specified by:
convert in class TSynchronousFilteredAudioInputStream
Returns:
the resulting number of frames converted and put into outBuffer. The return value is in the format of this stream.

convertInPlace

protected void convertInPlace(byte[] buffer,
                              int byteOffset,
                              int frameCount)
Description copied from class: TSynchronousFilteredAudioInputStream
Override this method to provide in-place conversion of samples. To use it, call "enableConvertInPlace()". It will only be used when input bytes per frame >= output bytes per frame. This method must always convert frameCount frames, so no return value is necessary.

Overrides:
convertInPlace in class TSynchronousFilteredAudioInputStream