net.sf.fmj.media.multiplexer.audio
Class JavaSoundMux
java.lang.Object
net.sf.fmj.media.AbstractControls
net.sf.fmj.media.AbstractPlugIn
net.sf.fmj.media.AbstractMultiplexer
net.sf.fmj.media.multiplexer.AbstractStreamCopyMux
net.sf.fmj.media.multiplexer.audio.JavaSoundMux
- All Implemented Interfaces:
- Controls, Multiplexer, PlugIn
- Direct Known Subclasses:
- AIFFMux, AUMux, WAVMux
public abstract class JavaSoundMux
- extends AbstractStreamCopyMux
Audio multiplexer base class implemented using JavaSound.
This mux has the job of taking buffers passed in to process, and converting them to a stream to be read by
Javasound, and then converting the stream written by Javasound into something that can be read
as a track of a datasource.
TODO: size is written to file headers as Integer.MAXINT, because the seeking back to the beginning and
rewriting of the header is not yet implemented.
JMF appears to do this with a hack, casting the SourceTransferHandler to a Seekable, and seeking the output,
then rewriting.
TODO: not so sure of all the open/close/connect/disconnect and which should call what when.
- Author:
- Ken Larson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaSoundMux
public JavaSoundMux(FileTypeDescriptor fileTypeDescriptor,
javax.sound.sampled.AudioFileFormat.Type audioFileFormatType)
setNumTracks
public int setNumTracks(int numTracks)
- Specified by:
setNumTracks
in interface Multiplexer
- Overrides:
setNumTracks
in class AbstractStreamCopyMux
createInputStreamPushDataSource
protected StreamCopyPushDataSource createInputStreamPushDataSource(ContentDescriptor outputContentDescriptor,
int numTracks,
java.io.InputStream[] inputStreams,
Format[] inputFormats)
- Overrides:
createInputStreamPushDataSource
in class AbstractStreamCopyMux
getSupportedInputFormats
public Format[] getSupportedInputFormats()
- Specified by:
getSupportedInputFormats
in interface Multiplexer
- Specified by:
getSupportedInputFormats
in class AbstractStreamCopyMux
write
protected void write(java.io.InputStream in,
java.io.OutputStream out,
javax.sound.sampled.AudioFormat javaSoundFormat)
throws java.io.IOException
- Throws:
java.io.IOException