com.vwp.sound.mod.sound.output
Class WavOutput
java.lang.Object
com.vwp.sound.mod.sound.output.WavOutput
- All Implemented Interfaces:
- Output
public class WavOutput
- extends Object
- implements Output
Writes output to a Wav file. Only 44100Hz, 16 bits, stereo supported
- Author:
- hongve
| Fields inherited from interface com.vwp.sound.mod.sound.output.Output |
INPUT_RATE |
|
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. |
RIFF_MAGIC
public static final String RIFF_MAGIC
- See Also:
- Constant Field Values
WAVE_MAGIC
public static final String WAVE_MAGIC
- See Also:
- Constant Field Values
FORMAT_MAGIC
public static final 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 String DATA_MAGIC
- See Also:
- Constant Field Values
WavOutput
public WavOutput(String filename,
SoundDataFormat format)
throws IOException
- Throws:
IOException
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 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 writeofs - the offset in data to write fromlen - the number of samples to write
- Returns:
- the number of samples actually written
- Throws:
IOException- See Also:
Output.write(byte[], int, int)