RFR: 8356049: Need a simple way to play back a sound clip

Hendrik Schick duke at openjdk.org
Fri May 2 17:18:51 UTC 2025


On Thu, 1 May 2025 22:31:32 GMT, Phil Race <prr at openjdk.org> wrote:

> A simple API to replace java.applet.AudioClip

src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 101:

> 99:             clip.init(stream);
> 100:         } catch (final Exception e) {
> 101:             // AudioClip will be no-op if some exception will occurred

Suggestion:

            // AudioClip will be no-op if some exception will occur

or 'has occurred' (?)

src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 114:

> 112:             clip.init(uc.getInputStream());
> 113:         } catch (final Exception ignored) {
> 114:             // Playing the clip will be a no-op if an exception occured in inititialization.

Suggestion:

            // Playing the clip will be a no-op if an exception occured in initialization.

src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 124:

> 122:             clip.init(url.openStream());
> 123:         } catch (final Exception ignored) {
> 124:             // Playing the clip will be a no-op if an exception occurred in inititialization.

Suggestion:

            // Playing the clip will be a no-op if an exception occurred in initialization.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071917249
PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071917636
PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071917934


More information about the client-libs-dev mailing list