Skip to content
← Back to Community
Java Jar / Music
Profile icon
h
has Hacker Plan
WilsonPaul

Are java jars supported? I'd like to use JFugue for music as an example, but anything would be possible with jars.

Voters
Profile icon
Mexenteryo
Profile icon
WilsonPaul
Comments
hotnewtop
Profile icon
theangryepicbanana

jars should be supported, but audio is not supported (I mentioned that because of the title of the post)

Profile icon
WilsonPaul

@theangryepicbanana Actually, sound is supported - Java's javax.sound packages are there and working. I have a test case even working with sound - just using Java's HttpServer to output audio/wav via the web. But trying to do sound without a library is very very complex - and Java Jar library's would make this and many other things easy and teachable!

Profile icon
JacquesFleische

@WilsonPaul Wilson, would you be able to link to the repl with the working sound? Thank you kindly

Profile icon
WilsonPaul

@JacquesFleische I have never had the time / need to explore this, but I do know that ReplIt does support this and much more now. See their docs: https://docs.replit.com/misc/playing-audio-replit. There was also an example project I saw once from someone else that had it working in Java. The shortcomings of 3 years ago are certainly gone, but this one isn't one of my priorities personally.

Profile icon
JacquesFleische

@WilsonPaul Thank you so much. I actually did look at this page but it was unfortunate as they only seem to support JavaScript and Python for audio.

Profile icon
JacquesFleische

@WilsonPaul Never mind you are absolutely right. I see the little headphones icon in the bottom right of my project when running Java on replit. And audio works without any special httpserver.
perhaps it was just because i had to add "audio = true" to my .replit file

Profile icon
WilsonPaul

@JacquesFleische https://replit.com/@WilsonPaul/Holiday-Song-Example-Code - this is not mine, it was a fork I saved from someone else. It certainly does do sound with Java. You have to click the headphones icon to approve it. The underlying tech is no different for Python - they both can only do it using VNC. Javascript is easier if you are doing it on a webpage since that is client-side already!