<div dir="ltr">I tried to dig into the archives for the two rotted links.<div><br></div><div>The first is a link to <a href="https://mail.openjdk.org/pipermail/audio-engine-dev/2007-October/000024.html" target="_blank">an email</a> from Florian Bomers on Oct 12, 2007. He thought the class should be public:</div><div><br></div><div>>> As a 1st step I suggest to create such interface in com.sun.media.sound <br>>> package, and them move it to javax.sound.midi.<br><br>> I don't see an advantage for going in 2 steps, I'd prefer to put<br>> it in javax.sound.midi directly.<br></div><div><br></div><div>I couldn't find the second link, though. It gives no hint as to where or when it was emailed. It's likely in a jdk9 mailing list, but those are extensive and the mail server doesn't have a search function.</div><div><br></div><div>If you <i>really</i> need it, and you are okay with hacking your way into places where you shouldn't be, add --add-opens java.desktop/com.sun.media.sound=ALL-UNNAMED as a VM argument. Then, the following forbidden knowledge may work:</div><div><br></div><div>Class<?> synth = Class.forName("com.sun.media.sound.AudioSynthesizer");<br> Class<?> audio = Class.forName("com.sun.media.sound.SoftSynthesizer");<br><br> Method open = synth.getMethod("open", SourceDataLine.class, Map.class);<br> Constructor<?> declaredConstructor = audio.getDeclaredConstructor();<br> declaredConstructor.setAccessible(true);<br> Object o = declaredConstructor.newInstance();<br> <br> open.setAccessible(true);<br> open.invoke(o, null, null);<br></div><div><br></div><div>It's horrible but it seems to work in my tests. I wouldn't advise this; reflection to access protected classes is a Bad Idea.</div><div></div><div><br></div><div>SWinxy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 5, 2024 at 2:50 PM Aleksei Ivanov <<a href="mailto:alexey.ivanov@oracle.com" target="_blank">alexey.ivanov@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ithinu,<br>
<br>
This message belongs in client-libs-dev mailing list.<br>
<br>
I see Dalibor's message, “It didn't get done in time for JDK 9.” Yet the <br>
link in his message is broken now.<br>
<br>
Let's see if anyone has more details.<br>
<br>
On 2024-07-04 23:53, Ithinu wrote:<br>
> Hi,<br>
><br>
> AudioSynthesizer has a method open(line, config) which is the only way <br>
> of configuring its parameters and thus it seems <br>
> (<a href="https://bugs.openjdk.org/browse/JDK-6941027" rel="noreferrer" target="_blank">https://bugs.openjdk.org/browse/JDK-6941027</a>) that it was intended to <br>
> be made public. It is not the case in JDK 21. There were other useful <br>
> classes, like FFT, that are also no longer accessible.<br>
><br>
> According to <br>
> <a href="https://forums.oracle.com/ords/apexds/post/com-sun-media-sound-in-java-9-0673" rel="noreferrer" target="_blank">https://forums.oracle.com/ords/apexds/post/com-sun-media-sound-in-java-9-0673</a> <br>
> "it didn't get done in time for JDK 9".<br>
><br>
> Is it plausible that someone will eventually look into that? Thanks.<br>
-- <br>
Regards,<br>
Alexey<br>
</blockquote></div>