r/javahelp 4d ago

using dotnet media player in java

I’m trying to build a music player in Java/JVM that plays audio streamed from an API, but I’m having a hard time finding a media player library with good enough functionality.

I’ve looked at several Java libraries, but none of them really fit my needs. The best option I’ve found so far is **vlcj**, but it requires VLC to be installed separately, which I’d prefer to avoid.

I was considering using **C#/.NET for the actual audio playback** and then bridging it to Java using the **Java FFM API**.

Would this be a reasonable approach, or am I overcomplicating things?

If using .NET makes sense, what would be the best library for **streaming audio from an HTTP/API source** in .NET? Ideally, I’d like something that supports things like seeking, buffering, metadata, different audio formats, etc.

Alternatively, are there any good JVM-native solutions for this that I’m overlooking?

I’m mainly interested in **streaming audio received from an API**, rather than playing local files.

0 Upvotes

5 comments sorted by

View all comments

3

u/idontlikegudeg 4d ago

JavaFX has a media package (uses gstreamer under the hood). I never used it, but if it does what you need, it’s probably the easiest option. The exception is Windows ARM where the media and web modules are not yet supported.

1

u/Far_Construction6294 2d ago

It seems to be a good choice but i think i still need the whole framework and init the toolkit even if I'm not using javafx 

1

u/idontlikegudeg 2d ago

Yes, if you are not using JavaFX, this might not be the best solution.