use of com.sun.media.sound.SF2SoundbankReader in project jdk8u_jdk by JetBrains.
the class TestGetSoundbankFile method main.
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("test.src", "."), "ding.sf2");
Soundbank sf2 = new SF2SoundbankReader().getSoundbank(file);
assertTrue(sf2.getInstruments().length == 1);
Patch patch = sf2.getInstruments()[0].getPatch();
assertTrue(patch.getProgram() == 0);
assertTrue(patch.getBank() == 0);
}
use of com.sun.media.sound.SF2SoundbankReader in project jdk8u_jdk by JetBrains.
the class TestGetSoundbankInputStream method main.
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("test.src", "."), "ding.sf2");
FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);
try {
Soundbank sf2 = new SF2SoundbankReader().getSoundbank(bis);
assertTrue(sf2.getInstruments().length == 1);
Patch patch = sf2.getInstruments()[0].getPatch();
assertTrue(patch.getProgram() == 0);
assertTrue(patch.getBank() == 0);
} finally {
bis.close();
}
}
use of com.sun.media.sound.SF2SoundbankReader in project jdk8u_jdk by JetBrains.
the class TestGetSoundbankInputStream2 method main.
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("test.src", "."), "ding.sf2");
FileInputStream fis = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(fis);
try {
InputStream badis = new BadInputStream(bis);
Soundbank sf2 = new SF2SoundbankReader().getSoundbank(badis);
assertTrue(sf2.getInstruments().length == 1);
Patch patch = sf2.getInstruments()[0].getPatch();
assertTrue(patch.getProgram() == 0);
assertTrue(patch.getBank() == 0);
} finally {
bis.close();
}
}
use of com.sun.media.sound.SF2SoundbankReader in project jdk8u_jdk by JetBrains.
the class TestGetSoundbankUrl method main.
public static void main(String[] args) throws Exception {
File file = new File(System.getProperty("test.src", "."), "ding.sf2");
URL url = file.toURI().toURL();
Soundbank sf2 = new SF2SoundbankReader().getSoundbank(url);
assertTrue(sf2.getInstruments().length == 1);
Patch patch = sf2.getInstruments()[0].getPatch();
assertTrue(patch.getProgram() == 0);
assertTrue(patch.getBank() == 0);
}
Aggregations