com.vwp.sound.mod.sound.output
Class WavOutput

java.lang.Object
  extended by com.vwp.sound.mod.sound.output.WavOutput
All Implemented Interfaces:
Output

public class WavOutput
extends java.lang.Object
implements Output

Writes output to a Wav file. Only 44100Hz, 16 bits, stereo supported


Field Summary
static java.lang.String DATA_MAGIC
           
static int FORMAT_LENGTH
           
static java.lang.String FORMAT_MAGIC
           
static short MORE_MAGIC
           
static java.lang.String RIFF_MAGIC
           
static java.lang.String WAVE_MAGIC
           
 
Fields inherited from interface com.vwp.sound.mod.sound.output.Output
INPUT_RATE
 
Constructor Summary
WavOutput(java.lang.String filename, SoundDataFormat format)
           
 
Method Summary
 boolean close()
          closes the output plugin
 boolean isOpen()
          tests if an output plugin is open for writeing
 boolean open()
          opens the output plugin for writing
 boolean supports(SoundDataFormat format)
           
 int write(byte[] data, int ofs, int len)
          try to write len bytes from offset ofs from the array data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RIFF_MAGIC

public static final java.lang.String RIFF_MAGIC
See Also:
Constant Field Values

WAVE_MAGIC

public static final java.lang.String WAVE_MAGIC
See Also:
Constant Field Values

FORMAT_MAGIC

public static final java.lang.String FORMAT_MAGIC
See Also:
Constant Field Values

FORMAT_LENGTH

public static final int FORMAT_LENGTH
See Also:
Constant Field Values

MORE_MAGIC

public static final short MORE_MAGIC
See Also:
Constant Field Values

DATA_MAGIC

public static final java.lang.String DATA_MAGIC
See Also:
Constant Field Values
Constructor Detail

WavOutput

public WavOutput(java.lang.String filename,
                 SoundDataFormat format)
          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

supports

public boolean supports(SoundDataFormat format)

isOpen

public boolean isOpen()
Description copied from interface: Output
tests if an output plugin is open for writeing

Specified by:
isOpen in interface Output
Returns:
true if the Output is open, false else
See Also:
Output.isOpen()

open

public boolean open()
Description copied from interface: Output
opens the output plugin for writing

Specified by:
open in interface Output
Returns:
true if the plugin was successfully opened, false else
See Also:
Output.open()

close

public boolean close()
Description copied from interface: Output
closes the output plugin

Specified by:
close in interface Output
Returns:
true if the plugin was successfully closed, false else
See Also:
Output.close()

write

public int write(byte[] data,
                 int ofs,
                 int len)
          throws java.io.IOException
Description copied from interface: Output
try to write len bytes from offset ofs from the array data.

Specified by:
write in interface Output
Parameters:
data - the array containing data to write
ofs - the offset in data to write from
len - the number of samples to write
Returns:
the number of samples actually written
Throws:
java.io.IOException
See Also:
Output.write(byte[], int, int)