Results 1 to 3 of 3
- 02-25-2011, 03:15 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 7
- Rep Power
- 0
Help: " no pulse-java" problem - Head First Java
I'm reading "Head First Java" right now and I'm having trouble getting some code to work that is straight from the book. Below is the code. This program is a simple midi player. It compiles fine, but at run time it messes up.
Below is what is happening when I run the code. Does anyone know what I'm doing wrong or missing?Java Code:import javax.sound.midi.*; public class MiniMiniMusicApp { public static void main(String[] args) { MiniMiniMusicApp mini = new MiniMiniMusicApp(); mini.play(); } public void play() { try { Sequencer 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(); b.setMessage(128, 1, 44, 100); MidiEvent noteOff = new MidiEvent(b, 16); track.add(noteOff); player.setSequence(seq); player.start(); } catch (Exception ex) { ex.printStackTrace(); } } }
Exception in thread "main" java.lang.UnsatisfiedLinkError: no pulse-java in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1681)
at java.lang.Runtime.loadLibrary0(Runtime.java:840)
at java.lang.System.loadLibrary(System.java:1047)
at org.classpath.icedtea.pulseaudio.SecurityWrapper.l oadNativeLibrary(SecurityWrapper.java:27)
at org.classpath.icedtea.pulseaudio.EventLoop.<clinit >(EventLoop.java:105)
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.o penImpl(PulseAudioMixer.java:654)
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.o penLocal(PulseAudioMixer.java:588)
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.o penLocal(PulseAudioMixer.java:584)
at org.classpath.icedtea.pulseaudio.PulseAudioMixer.o pen(PulseAudioMixer.java:579)
at org.classpath.icedtea.pulseaudio.PulseAudioDataLin e.open(PulseAudioDataLine.java:95)
at org.classpath.icedtea.pulseaudio.PulseAudioSourceD ataLine.open(PulseAudioSourceDataLine.java:75)
at com.sun.media.sound.SoftSynthesizer.open(SoftSynth esizer.java:1077)
at com.sun.media.sound.SoftSynthesizer.open(SoftSynth esizer.java:1036)
at com.sun.media.sound.SoftSynthesizer.getReceiverRef erenceCounting(SoftSynthesizer.java:1337)
at javax.sound.midi.MidiSystem.getSequencer(MidiSyste m.java:431)
at javax.sound.midi.MidiSystem.getSequencer(MidiSyste m.java:365)
at MiniMiniMusicApp.play(MiniMiniMusicApp.java:14)
at MiniMiniMusicApp.main(MiniMiniMusicApp.java:8)
- 02-25-2011, 05:22 PM #2
Member
- Join Date
- Feb 2011
- Posts
- 7
- Rep Power
- 0
I forgot to mention that my OS is ubuntu 10.10
- 02-25-2011, 07:13 PM #3
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
Similar Threads
-
Exception in thread "main" java.lang.Error: Unresolved compilation problem
By jcen in forum New To JavaReplies: 2Last Post: 11-06-2011, 04:40 PM -
Exception in thread "main" java.lang.Error: Unresolved compilation problem: at Addr
By erin.ctm in forum New To JavaReplies: 6Last Post: 12-04-2010, 08:36 AM -
Java, Military Format using "/" and "%" Operator!!
By sk8rsam77 in forum New To JavaReplies: 11Last Post: 02-26-2010, 03:03 AM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks