Skip to content
← Back to Community
Audio in java
Profile icon
GeneralBaker

I wanted to make music play in java, but I am not sure where to start. I would be fine with a link to a document explaining how to do it or anything else that would help me understand.

Please note I am using pure java, not java swing or anything else.

Thanks!

Voters
Profile icon
Dominicl645
Profile icon
GeneralBaker
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

This link will tell you how to do it:

https://www.geeksforgeeks.org/play-audio-file-using-java/

Profile icon
GeneralBaker

I saw this but couldn't make it work :/ If you could explain more what this means that would be great! @RYANTADIPARTHI

Profile icon
RYANTADIPARTHI

@GeneralBaker you just have to mold the code i gave into your own, try reading closer. If it still doesn't help, just ping me.

Profile icon
Bookie0

check this out, you can make your own library for repl.it audio! :)

Profile icon
GeneralBaker

Perfect! Just what I needed. Thank you! @Bookie0

Profile icon
GeneralBaker

Whoops nvm this looks like it is only for javascript and python. I am trying to do this with java... @Bookie0

Profile icon
Bookie0

@GeneralBaker yea, check out how to make ur own library! :)

Profile icon
GeneralBaker

Ok didn't see that part but how do you do this:

To make this as light as possible on your repl's resources, audio files are played via a request system. To make a request, simply write to a named pype, /tmp/audio."

@Bookie0

Profile icon
Dominicl645

click the 3 dots next to files, and then click upload file, and then you can upload your .mp3 file or u can just put in the URL and it will take it that way.
https://docs.repl.it/tutorials/12-audio