RFR: 8356049: Need a simple way to play back a sound clip [v6]
Phil Race
prr at openjdk.org
Tue May 20 22:36:56 UTC 2025
On Tue, 20 May 2025 22:25:12 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> btw why not mark this as an incubator/preview feature and look at the reviews?
I don't think that necessary for this case.
> I wonder about the limitation to `java.io.File` as source for sound clips. Allowing playback from an `InputStream` allows developers to use their own packaging, compression, bundling, or use dynamically generated sound clips, and to work around missing file access permissions. How about this additional factory method:
>
> ```
> public static SoundClip createSoundClip(InputStream file) throws IOException;
> ```
>
> The implementation is simple, because it boils down to an InputStream internally anyway, and testing is equally simple.
InputStreams can be from anywhere - including a network. This isn't intended for that so it deliberately makes you supply a file.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2895981120
More information about the client-libs-dev
mailing list