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

Supported file formats #38

Open HelgeStenstrom opened 5 years ago

HelgeStenstrom commented 5 years ago

The description claims that java-stream-player supports ogg, flac, speex and other formats. How does that happen? I have searched for the word flac in the code, but haven't found it.

It would be good with a few small sample audio files in the supported formats. The files should be free to use, of course.

goxr3plus commented 5 years ago

You can try to play .flac and it plays :) But i don't think it supports any .flac you will add :) . Yes we need small samples for all audio formats .

HelgeStenstrom commented 5 years ago

I haven't tested with flac, but I might have some file on my drive. But the question was: How does it happen? In other words: Where is the implementation of flac support? Which part of the software is aware of different audio file types?

goxr3plus commented 5 years ago

@HelgeStenstrom Tha's a nice question :) . Look how it works .

We have added https://github.com/goxr3plus/java-stream-player/blob/f1ba0e325218b46be15dcdd75a860ef886098de9/pom.xml#L107-L111

which gives as the ability to play .flac files . But how that attaches to our library right ? Well it downloads the .jar file which if you open has inside has the below :

image

From which java audio system understands which codec to use for .flac files . Actually i was reading about this in some old Java Tutorials .

HelgeStenstrom commented 5 years ago

I saw that in the pom file, but I don't see where the jflac-codec is actually used. Maybe I didn't find it because the package name is different from the artifactId.

I'll have to test with a flac file someday.

goxr3plus commented 5 years ago

Maybe i add a special package called AudioTools which the user can use to retrieve audio data , duration , read .mp3 metadata etc . i have it in XR3Player but i should export it here .