|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
com.groovemanager.sampled.providers.AudioFileOutputStream
com.groovemanager.sampled.providers.WavFileOutputStream
This class is an AudioFileOutputStream implementation for writing Wav files.
| Field Summary | |
|---|---|
private int |
chunklength
Bytelength of all chunks |
private java.util.ArrayList |
chunks
List of additional WaveChunks to write when closing |
private boolean |
closed
Indicates whether this stream has been closed or not |
private java.nio.ByteBuffer |
header
A byteBuffer wrapped around the Wav header |
private static byte[] |
headerData
The header data containing the RIFF identifier, the WAVE identifier, the fmt chunk, the data chunk ID and the data chunk length |
private java.io.FileOutputStream |
out
FileOutputStream for writing |
private int |
written
Number of bytes written so far |
| Fields inherited from class com.groovemanager.sampled.providers.AudioFileOutputStream |
|---|
format, outputFile, properties, type |
| Constructor Summary | |
|---|---|
WavFileOutputStream(java.io.File f,
javax.sound.sampled.AudioFormat format,
java.util.Map properties)
Construct a new WavFileOutputStream |
|
| Method Summary | |
|---|---|
void |
addChunk(WaveChunk c)
Add a WaveChunk to be written to the file |
void |
close()
|
void |
flush()
|
private void |
initHeader()
Initialize the header with the data known so far |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
private void |
writeChunks()
Write the chunks to the file |
private void |
writeHeader()
Write the header data after all other data has been written |
| Methods inherited from class com.groovemanager.sampled.providers.AudioFileOutputStream |
|---|
getFormat, getOutputFile, getType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int chunklength
private java.util.ArrayList chunks
private boolean closed
private java.nio.ByteBuffer header
private static byte[] headerData
private java.io.FileOutputStream out
private int written
| Constructor Detail |
|---|
public WavFileOutputStream(java.io.File f,
javax.sound.sampled.AudioFormat format,
java.util.Map properties)
throws java.io.IOException
f - The file to write toformat - The format in which to write audio dataproperties - Map of properties to write to the file, if supported
java.io.IOException - If an I/O Error occurs during OutputStream creation| Method Detail |
|---|
public void addChunk(WaveChunk c)
c - The WaveChunk to add
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException
public void flush()
throws java.io.IOException
flush in class java.io.OutputStreamjava.io.IOExceptionprivate void initHeader()
public void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
private void writeChunks()
throws java.io.IOException
java.io.IOException - If an I/O Error occurs during the write operation
private void writeHeader()
throws java.io.IOException
java.io.IOException - If an I/O Error occurs during the write operation
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||