goxr3plus / java-stream-player

🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
GNU General Public License v3.0
145 stars 33 forks source link

File of Unsupported Format #73

Closed omegaui closed 2 years ago

omegaui commented 2 years ago

Hi! I have been developing an IDE. And I created a music player plugin using java-stream-player. I am using JDK v17.

The problem is when I generated the .jar file of the plugin By embedding the dependencies and all.

Its giving me this exception

ubuntu@ubuntu:~$ omega-ide
Jan 12, 2022 8:49:27 PM com.goxr3plus.streamplayer.stream.StreamPlayerEventLauncher call
INFO: Stream player Status -> NOT_SPECIFIED
got : /home/ubuntu/Downloads/Faded X - Lofi Remix.mp3
Jan 12, 2022 8:49:33 PM com.goxr3plus.streamplayer.stream.StreamPlayer open
INFO: open(/home/ubuntu/Downloads/Faded X - Lofi Remix.mp3)

Jan 12, 2022 8:49:33 PM com.goxr3plus.streamplayer.stream.StreamPlayer initAudioInputStream
INFO: Entered initAudioInputStream

Jan 12, 2022 8:49:33 PM com.goxr3plus.streamplayer.stream.StreamPlayerEventLauncher call
INFO: Stream player Status -> NOT_SPECIFIED
Jan 12, 2022 8:49:33 PM com.goxr3plus.streamplayer.stream.StreamPlayerEventLauncher call
INFO: Stream player Status -> OPENING
Jan 12, 2022 8:49:33 PM com.goxr3plus.streamplayer.stream.StreamPlayer initAudioInputStream
INFO: File of unsupported format
javax.sound.sampled.UnsupportedAudioFileException: File of unsupported format
    at java.desktop/javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1066)
    at com.goxr3plus.streamplayer.stream.FileDataSource.getAudioInputStream(FileDataSource.java:29)
    at com.goxr3plus.streamplayer.stream.StreamPlayer.initAudioInputStream(StreamPlayer.java:338)
    at com.goxr3plus.streamplayer.stream.StreamPlayer.open(StreamPlayer.java:291)
    at omega.vibencode.MusicPlayerPanel.play(MusicPlayerPanel.java:176)
    at omega.vibencode.QueueView.lambda$genList$0(QueueView.java:53)
    at omegaui.component.TextComp$1.mousePressed(TextComp.java:134)
    at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6623)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
    at java.desktop/java.awt.Component.processEvent(Component.java:6391)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4572)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

javax.sound.sampled.UnsupportedAudioFileException: File of unsupported format
    at java.desktop/javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1066)
    at com.goxr3plus.streamplayer.stream.FileDataSource.getAudioInputStream(FileDataSource.java:29)
    at com.goxr3plus.streamplayer.stream.StreamPlayer.initAudioInputStream(StreamPlayer.java:338)
    at com.goxr3plus.streamplayer.stream.StreamPlayer.open(StreamPlayer.java:291)
    at omega.vibencode.MusicPlayerPanel.play(MusicPlayerPanel.java:176)
    at omega.vibencode.QueueView.lambda$genList$0(QueueView.java:53)
    at omegaui.component.TextComp$1.mousePressed(TextComp.java:134)
    at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6623)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
    at java.desktop/java.awt.Component.processEvent(Component.java:6391)
    at java.desktop/java.awt.Container.processEvent(Container.java:2266)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4572)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Here, the line

got : /home/ubuntu/Downloads/Faded X - Lofi Remix.mp3

is the path of the file passed to StreamPlayer.open() method.

I am able to play the file in development version of the IDE without this exception. But I am unable to play it using the plugin.

omegaui commented 2 years ago

What I can simply conclude is that java-stream-player's fat jar is giving this exception.

omegaui commented 2 years ago

Sorry! For this issue.

But I was actually missing some dependencies.

goxr3plus commented 2 years ago

@omegaui Can you help @PixelDoted on this issue :) ? https://github.com/goxr3plus/java-stream-player/issues/74