FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
Just one thing
earphones
Why you should not be using Ubuntu!
Internet crashes, getting the following error...
No sound in Flash animations
Java bufferedReader problem
Worlds worst hacker
Fedora - Problem with sound and internet
Notepad in java
Noob Java Error
review my code
Problem with sound on Linux?
Dell Inspiron 1420 Windows 7 sound problem
what is wrong with this java code?
Reply to topic    Frihost Forum Index -> Scripting -> Others

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