//Supported audio file formats: mid, rmf
try {
Sequencer sequencer = MidiSystem.getSequencer();
sequencer.open();
// From file
InputStream is = new BufferedInputStream(
new FileInputStream(new File("midifile")));
// From URL
is = new BufferedInputStream(
new URL("http://hostname/rmffile").openStream());
sequencer.setSequence(is);
// Start playing
sequencer.start();
} catch (MalformedURLException e) {
} catch (IOException e) {
} catch (MidiUnavailableException e) {
} catch (InvalidMidiDataException e) {
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment