javax.sound.midi
public class MidiSystem extends Object
Since: 1.3
Method Summary | |
---|---|
static MidiDevice | getMidiDevice(MidiDevice.Info info)
Get the specified MIDI device.
|
static MidiDevice.Info[] | getMidiDeviceInfo()
Get an array of all available MIDI devices.
|
static MidiFileFormat | getMidiFileFormat(InputStream stream)
Read a MidiFileFormat object from the given stream.
|
static MidiFileFormat | getMidiFileFormat(URL url)
Read a MidiFileFormat object from the given url.
|
static MidiFileFormat | getMidiFileFormat(File file)
Read a MidiFileFormat object from the given file.
|
static int[] | getMidiFileTypes()
Return an array of supported MIDI file types on this system.
|
static int[] | getMidiFileTypes(Sequence sequence)
Return an array of supported MIDI file types on this system
for the given sequnce.
|
static Receiver | getReceiver()
Get the default Receiver instance. |
static Sequence | getSequence(InputStream stream)
Read a Sequence object from the given stream.
|
static Sequence | getSequence(URL url)
Read a Sequence object from the given url.
|
static Sequence | getSequence(File file)
Read a Sequence object from the given file.
|
static Sequencer | getSequencer()
Get the default Sequencer instance. |
static Soundbank | getSoundbank(InputStream stream)
Read a Soundbank object from the given stream.
|
static Soundbank | getSoundbank(URL url)
Read a Soundbank object from the given url.
|
static Soundbank | getSoundbank(File file)
Read a Soundbank object from the given file.
|
static Synthesizer | getSynthesizer()
Get the default Synthesizer instance. |
static Transmitter | getTransmitter()
Get the default Transmitter instance. |
static boolean | isFileTypeSupported(int fileType)
Return true if the system supports writing files of type fileType.
|
static boolean | isFileTypeSupported(int fileType, Sequence sequence)
Return true if the system supports writing files of type fileType
for the given sequence.
|
static int | write(Sequence in, int fileType, OutputStream out)
Write a sequence to an output stream using a specific MIDI file format.
|
static int | write(Sequence in, int fileType, File out)
Write a sequence to a file using a specific MIDI file format.
|
Parameters: info a description of the device we're looking for
Returns: the requested MIDI device
Throws: MidiUnavailableException if no MIDI devices are configured or found IllegalArgumentException if the device described by info is not found
Returns: a possibly empty array of all available MIDI devices
Parameters: stream the stream from which to read the MidiFileFormat
Returns: the MidiFileFormat object
Throws: InvalidMidiDataException if we were unable to read the MidiFileFormat IOException if an I/O error happened while reading
Parameters: url the url from which to read the MidiFileFormat
Returns: the MidiFileFormat object
Throws: InvalidMidiDataException if we were unable to read the MidiFileFormat IOException if an I/O error happened while reading
Parameters: file the file from which to read the MidiFileFormat
Returns: the MidiFileFormat object
Throws: InvalidMidiDataException if we were unable to read the MidiFileFormat IOException if an I/O error happened while reading
Returns: the array of supported MIDI file types
Parameters: sequence the sequnce to write
Returns: the array of supported MIDI file types
Returns: the default Receiver instance
Throws: MidiUnavailableException if no Receiver is found
Parameters: stream the stream from which to read the Sequence
Returns: the Sequence object
Throws: InvalidMidiDataException if we were unable to read the Sequence IOException if an I/O error happened while reading
Parameters: url the url from which to read the Sequence
Returns: the Sequence object
Throws: InvalidMidiDataException if we were unable to read the Sequence IOException if an I/O error happened while reading
Parameters: file the file from which to read the Sequence
Returns: the Sequence object
Throws: InvalidMidiDataException if we were unable to read the Sequence IOException if an I/O error happened while reading
Returns: the default Sequencer instance
Throws: MidiUnavailableException if no Sequencer is found
Parameters: stream the stream from which to read the Soundbank
Returns: the Soundbank object
Throws: InvalidMidiDataException if we were unable to read the soundbank IOException if an I/O error happened while reading
Parameters: url the url from which to read the Soundbank
Returns: the Soundbank object
Throws: InvalidMidiDataException if we were unable to read the soundbank IOException if an I/O error happened while reading
Parameters: file the file from which to read the Soundbank
Returns: the Soundbank object
Throws: InvalidMidiDataException if we were unable to read the soundbank IOException if an I/O error happened while reading
Returns: the default Synthesizer instance
Throws: MidiUnavailableException if no Synthesizer is found
Returns: the default Transmitter instance
Throws: MidiUnavailableException if no Transmitter is found
Parameters: fileType the MIDI file type we want to write
Returns: true if we can write fileType files, false otherwise
Parameters: fileType the MIDI file type we want to write sequence the Sequence we want to write
Returns: true if we can write fileType files for sequence, false otherwise
Parameters: in the sequence to write fileType the MIDI file format to use out the output stream to write to
Returns: the number of bytes written
Throws: IOException if an I/O exception happens IllegalArgumentException if fileType is not supported for in
Parameters: in the sequence to write fileType the MIDI file format to use out the file to write to
Returns: the number of bytes written
Throws: IOException if an I/O exception happens IllegalArgumentException if fileType is not supported for in