org.tritonus.sampled.file
Class WaveAudioFileWriter

java.lang.Object
  extended byjavax.sound.sampled.spi.AudioFileWriter
      extended byorg.tritonus.share.sampled.file.TAudioFileWriter
          extended byorg.tritonus.sampled.file.WaveAudioFileWriter

public class WaveAudioFileWriter
extends TAudioFileWriter

Class for writing Microsoft(tm) WAVE files

Author:
Florian Bomers

Field Summary
 
Fields inherited from class org.tritonus.share.sampled.file.TAudioFileWriter
NULL_TYPE_ARRAY, PCM_SIGNED, PCM_UNSIGNED
 
Constructor Summary
WaveAudioFileWriter()
           
 
Method Summary
protected  AudioOutputStream getAudioOutputStream(AudioFormat audioFormat, long lLengthInBytes, AudioFileFormat.Type fileType, TDataOutputStream dataOutputStream)
           
protected  boolean isAudioFormatSupportedImpl(AudioFormat format, AudioFileFormat.Type fileType)
          Checks whether the passed AudioFormat can be handled.
 
Methods inherited from class org.tritonus.share.sampled.file.TAudioFileWriter
getAudioFileTypes, getAudioFileTypes, getSupportedAudioFormats, isFileTypeSupported, isFileTypeSupported, write, write, writeImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaveAudioFileWriter

public WaveAudioFileWriter()
Method Detail

isAudioFormatSupportedImpl

protected boolean isAudioFormatSupportedImpl(AudioFormat format,
                                             AudioFileFormat.Type fileType)
Description copied from class: TAudioFileWriter
Checks whether the passed AudioFormat can be handled. In this simple implementation, it is only checked if the passed AudioFormat matches one of the generally handled formats (i.e. the fileType argument is ignored). If the handled AudioFormats depend on the file type, this method or getSupportedAudioFormats() (on which this method relies) has to be overwritten by subclasses.

This is the central method for checking if a FORMAT is supported. Inheriting classes can overwrite this for performance or to exclude/include special type/format combinations.

This method is only called when the fileType is in the list of supported file types ! Overriding classes need not check this.

Overrides:
isAudioFormatSupportedImpl in class TAudioFileWriter

getAudioOutputStream

protected AudioOutputStream getAudioOutputStream(AudioFormat audioFormat,
                                                 long lLengthInBytes,
                                                 AudioFileFormat.Type fileType,
                                                 TDataOutputStream dataOutputStream)
                                          throws IOException
Specified by:
getAudioOutputStream in class TAudioFileWriter
Throws:
IOException