Example usage for javax.sound.midi MidiFileFormat getType

List of usage examples for javax.sound.midi MidiFileFormat getType

Introduction

In this page you can find the example usage for javax.sound.midi MidiFileFormat getType.

Prototype

public int getType() 

Source Link

Document

Obtains the MIDI file type.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    // From file// ww  w.  j a  v a2s .co  m
    MidiFileFormat fformat = MidiSystem.getMidiFileFormat(new File("midifile"));

    // From URL
    //   fformat = MidiSystem.getMidiFileFormat(new URL("http://hostname/midifile"));

    // Get file format
    switch (fformat.getType()) {
    case 0:
        // mid
        break;
    case 1:
        // rmf
        break;
    }
}