RFR: 8356049: Need a simple way to play back a sound clip [v5]
Phil Race
prr at openjdk.org
Fri May 16 18:31:00 UTC 2025
On Tue, 13 May 2025 19:45:48 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> Or maybe we can add this API to AudioSystem/clip?
>> Old code
>>
>> File file = new File(file);
>> AudioInputStream audioIn = AudioSystem.getAudioInputStream(...file...);
>> Clip clip = AudioSystem.getClip();
>> clip.open(audioIn);
>> clip.start();
>>
>> new code:
>>
>> File file = new File(file);
>> AudioClip clip = AudioSystem.getAudioClip(...file...);
>> clip.play()/canPlay/loop/stop;
>
> or maybe inject all these simple methods into `javax.sound.sampled.Clip` or its subclass/superclass.
> Can we gain any benefits by using Path instead?
You had mentioned that and I looked but I didn't see any compelling reason.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087621643
More information about the client-libs-dev
mailing list