-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
OpenJDK6
-
generic
-
linux_ubuntu
An attempt to open a synthesizer leads to MidiUnavailableException if run with -Xfuture option.
Here is an example:
=======================================8<==================================
package testapp.sound.midi;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Synthesizer;
public class OpenSynthesizer {
public static void main(String[] args) {
OpenSynthesizer inst = new OpenSynthesizer();
try {
inst.m1();
} catch (Exception e) {
e.printStackTrace();
}
}
public void m1() throws Exception {
Synthesizer synth = MidiSystem.getSynthesizer();
System.out.print("Opening synthesizer...");
synth.open();
System.out.println("...done");
synth.close();
}
}
=======================================8<==================================
=======================================8<==================================
$ java -version
openjdk version "1.6.0-internal"
OpenJDK Runtime Environment (build 1.6.0-internal-dherron_19_dec_2007_13_45-b00)
Java HotSpot(TM) Client VM (build 11.0-b06, mixed mode)
$ java -Xfuture -cp . testapp.sound.midi.OpenSynthesizer
Opening synthesizer...javax.sound.midi.MidiUnavailableException: Audio Device Unavailable
at com.sun.media.sound.MixerSynth.implOpen(MixerSynth.java:163)
at com.sun.media.sound.AbstractMidiDevice.doOpen(AbstractMidiDevice.java:162)
at com.sun.media.sound.AbstractMidiDevice.open(AbstractMidiDevice.java:126)
at testapp.sound.midi.OpenSynthesizer.m1(OpenSynthesizer.java:22)
at testapp.sound.midi.OpenSynthesizer.main(OpenSynthesizer.java:12)
=======================================8<==================================
If no -Xfuture option is provided, the code works fine.
Here is an example:
=======================================8<==================================
package testapp.sound.midi;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Synthesizer;
public class OpenSynthesizer {
public static void main(String[] args) {
OpenSynthesizer inst = new OpenSynthesizer();
try {
inst.m1();
} catch (Exception e) {
e.printStackTrace();
}
}
public void m1() throws Exception {
Synthesizer synth = MidiSystem.getSynthesizer();
System.out.print("Opening synthesizer...");
synth.open();
System.out.println("...done");
synth.close();
}
}
=======================================8<==================================
=======================================8<==================================
$ java -version
openjdk version "1.6.0-internal"
OpenJDK Runtime Environment (build 1.6.0-internal-dherron_19_dec_2007_13_45-b00)
Java HotSpot(TM) Client VM (build 11.0-b06, mixed mode)
$ java -Xfuture -cp . testapp.sound.midi.OpenSynthesizer
Opening synthesizer...javax.sound.midi.MidiUnavailableException: Audio Device Unavailable
at com.sun.media.sound.MixerSynth.implOpen(MixerSynth.java:163)
at com.sun.media.sound.AbstractMidiDevice.doOpen(AbstractMidiDevice.java:162)
at com.sun.media.sound.AbstractMidiDevice.open(AbstractMidiDevice.java:126)
at testapp.sound.midi.OpenSynthesizer.m1(OpenSynthesizer.java:22)
at testapp.sound.midi.OpenSynthesizer.main(OpenSynthesizer.java:12)
=======================================8<==================================
If no -Xfuture option is provided, the code works fine.
- duplicates
-
JDK-6658097 An attempt to get a sequencer leads to MidiUnavailableException if run with -Xfuture
-
- Closed
-
-
JDK-6658108 An attempt to open a SourceDataLine leads to LineUnavailableException if run with -Xfuture
-
- Closed
-