Hi experts,
I have one small sound player app the code for which is given below but when i am trying to run it ,
there are some errors like cannot find the symbol play(),start().
Can anybody please help to find out what is wrong with this code
Code:import javax.sound.midi.*;
public class MiniMiniMusicApp
{
public static void main(String[] args)
{
MiniMiniMusicApp mini = new MiniMiniMusicApp();
mini.play();
} //closes the main method
public void play()
{
try
{
Sequence player = MidiSystem.getSequencer();
player.open();
Sequence seq = new Sequence(Sequence.PPQ , 4);
Track track = seq.createTrack();
ShortMessage a = new ShortMessage();
a.setMessage(144,1,44,100);
MidiEvent noteOn = new MidiEvent(a,1);
track.add(noteOn);
ShortMessage b = new ShortMessage();
a.setMessage(128,1,44,100);
MidiEvent noteOff = new MidiEvent(b,16);
track.add(noteOff);
player.setSequence(seq);
player.start();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
}
