FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Problem with javax.sound.midi (Java)

 


Twisol
I'm having problems compiling the code example from a book I have, "Head First Java"; for some obscure reason it's having trouble with one particular line:

Code:

Sequencer sequencer = MidiSystem.getSequencer();


I'm using NetBeans IDE (and I would suppose javac to compile), so I'm pretty sure it's not a problem with my having just switched from Notepad + javac (via cmd.exe) to NetBeans...

Oh, and the error:
Code:

cannot find symbol
symbol  : class getSequencer
location: class javax.sound.midi.MidiSystem
        Sequencer sequencer = new MidiSystem.getSequencer();


What am I doing wrong here? Neutral
MrBlueSky
Code:

cannot find symbol
symbol  : class getSequencer
location: class javax.sound.midi.MidiSystem
        Sequencer sequencer = new MidiSystem.getSequencer();


This error message seems to indicate that you actually have this line:

Code:

        Sequencer sequencer = new MidiSystem.getSequencer();


That is not gonna work, because getSequencer() is a static method of MidiSystem which returns a Sequencer object. Use this line:

Code:

        Sequencer sequencer = MidiSystem.getSequencer();


Without the new keyword.
Twisol
Oh, whoops. Guess it's another case of PEBKAC*... Embarassed


Problem Exists Between Keyboard And Chair
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.