0

I want to create a simple personal live audio system. Just like a personal radio station. (I know there are many personal radio station services, but I want to build my own here)

Here is a simple explanation I want to build.

1. Build a server side code with Java that keeps playing specific audio files 24/7

2. If I connect to 1's address from other devices I can listen to it

The point is that I want it to be like a radio station. It is not like the audio file is triggered to play by connecting 1.
1 is always playing and if I connect to it, I am going to get to listen what 1 is playing at the moment I connect to it.


I know this is a pretty broad question, so the simple steps are welcome.

i.e: You can use this java library to make server playing your music 24/7, and this method to listen to it.

Thank you for your help in advance.

EJP
  • 21
  • 4
  • I have **zero** idea, but if you want to do this "from scratch" as opposed to finding a library that exists, or using existing programs for ye olde internet radio. I'd be researching web sockets and web rtc https://stackoverflow.com/questions/18331407/streaming-media-to-server-using-web-socket so you can connect from any browser. – Ryan Leach Sep 27 '18 at 08:03
  • 1
    It's still hugely broad. Do you have any further restrictions on what software the clients can run? A web browser? a full desktop / jvm? If not, explicitly state that you have no restriction on the clients. – Ryan Leach Sep 27 '18 at 08:13
  • This might help, and be more related then my first comment. https://stackoverflow.com/questions/17044644/sending-audio-stream-over-tcp-unsupportedaudiofileexception – Ryan Leach Sep 27 '18 at 08:14

1 Answers1

0

Something like HTTP live streaming or MPEG-Dash should be relatively easy to implement in Java. Both work by splitting audio files into short segments and serving them via http, along with some metadata indicating the current position and which segments are up next.

There don't seem to be mature Java libraries for them, but one could probably use other tools like gstreamer. See the wikipedia pages for possible clients.

OhleC
  • 2,821
  • 16
  • 29
  • Thank you for the reply! "MPEG-Dash" plus "current position metadata" will do the job I guess. – EJP Sep 27 '18 at 08:53
  • The metadata is part of the MPEG-DASH specification; no need to cook up your own version. – OhleC Sep 27 '18 at 09:10