コード例 #1
0
 @Test
 public void testPlaySuccess() throws MidiUnavailableException, InvalidMidiDataException {
   AutoComposer ac = new SmoothComposer();
   ac.iniParameter(0, 5, 127, 1000, 500, 18);
   ac.generateMusic();
   MediaPlayer mp = new MediaMidiPlayer(ac);
   mp.play();
 }
コード例 #2
0
 @Test(expected = InvalidMidiDataException.class)
 public void testPlayFailed() throws MidiUnavailableException, InvalidMidiDataException {
   AutoComposer ac = new SmoothComposer();
   ac.iniParameter(0, 5, 128, 1000, 500, 18);
   ac.generateMusic();
   MediaPlayer mp = new MediaMidiPlayer(ac);
   mp.play();
 }