The fastest way to stream audio with java server - java

I want to develop a audio streaming server in java with human voice.
I would like to know if someone has already test the some technologies as httpserver (icecast, httpservlet as jetty) , rtspserver or webrtc. I need something faster. I think also to send stream with simple UDP and add some informations for client.
As audio format i think i'll use opus because it is optimized for human voice.
Thanks

i checked some technologies as Kurento but finally my choice is:
Encoding with opus
Sending stream to clients with UDP server
I would like to know if you ever worked for sending a stream with multiple thread. Because i dont know how i can share encoded stream between threads.
Because i want to create
1 Thread who listens connections from client and saves ip+port
1 Thread who captures micro and encodes the stream
1 Thread for each client for sending the encoded stream

Related

C++ to Java socket audio streaming

Hello, I'm trying to build client-server audio streaming app. Server has to be written in C and communicate with client using sockets (TCP). Client will be written in javafx (actually tornadofx, but that doesn't relate to the problem)
My doubts concern the streaming part. Server has several audio files. I want to be able to start, stop, rewind, skip to another song in the client app. Java has AFAIK two classes to play audio - Clip and SourceDataLine. I don't think sending the whole song before playing is the way to go (Clip, large sound files) so I guess I should stick with SourceDataLine. My simple guess is that I should send fairly small portion of audio every time the client comes close to listening the last portion he received. (e.g I send 30 seconds and when client is on 25th second he sends request for more) Is that right? Is that doable in previously mentioned technologies?
Maybe something like ffmpeg could be useful here
https://github.com/avTranscoder/avTranscoder
But again, I have to communicate over tcp sockets only.

Send continues data to client through websocket

I have a requirement to send the huge data through the websockets. My actual requirement is, the client communicates with my server for huge test data. My server will send the data assume the data size is 1GB. Its very hard to send this 1GB of data in a single response. So I choose the websockets. I am very new to this topic. I read about the websocets in multiple blogs and everyone gave a chat application example. But in my case client will ask once and my server needs to send the continues data. Is it possible to send the continues test data to the client with the websocets.? Can any one help me on this and if possible can you please provide an example.?
Note: I am using JAVA.
Thanks & Regards,
Amar.T
You already have the chat example. Use it. Try it on single computer. Probably you will need to create own protocol for sending/receiving data. Try to send by limited sizes blocks (for example 10 kb). So you will have 2 applications: client and server used websockets. I think that the main problem here is - What to do if connection was lost?

RESTful/JAX-RS with Swift?

I have built an Android application, which exchanges data with a server. For this purpose, there is a RESTful web service running on the server, written in Java with JAX-RS. The tricky thing is: I do exchange the data between application and server via Streams (Object- or FileOutputStream for example).
Now I want to build the same application for iOS, using Swift. Is there a way that I can read those Streams with Swift? And it is of course not only the reading of the Stream. As I do send Java Object, for example a String, can I receive this Object in Swift? I think it is not possible and I have to get rid of all that Streaming stuff and use Media.Types. But maybe I do have a chance to leave it like that?
Any ideas?
I think you are overcomplicating yourself a lot. The two apps should never have anything to do with each other. No matter what ecosystem they're running on (whether iOS, Android, Windows, etc) they shouldn't have to be aware of each other at all.
The same applies to the service. It shouldn't be concerned about which client is being consumed by. It should only care about receiving a "client-agnostic" request and serve the response. Now, the service would be SOAP/XML, plain json text, whatever. It's the client's responsibility to produce the correct request and understand the response from the server.
So, to answer your question...
Is there a way that I can read those Streams with Swift? And it is of course not only the reading of the Stream. As I do send Java Object, for example a String, can I receive this Object in Swift?
No, you're iOS app shouldn't have to deal with java code, it should only need to make the correct request to the server and understand the response...i.e. by making a service request using a NSURLConnection and parsing the response
So, just focus on making the service endpoint(s) platform-agnostic so that any client can consume it

Live audio streaming from Java server to browser (Flash,HTML5)

For a project, I need to be able to stream live audio from a Java server to the browser on the client. My first guess was to use RTMP with a Flash player, my second guess to make use of the HTML5 audio tag. But so far, I've failed to find anything useful (like a library), so does anyone have any pointers on how to do this?
Here's the setup: The sound comes in from a VoIP server as a bunch of PCM samples. From there, it has to go to get to the client, while usually only one client listens to one stream. So I need to be able to send many VoIP streams to several clients, a simple form of authentication would also be nice (like a token or a secret URL where the stream is located at).
So far, I've looked at Red5 (looks to me like one-to-many streaming only) and searched for Java-based RTMP libraries. Any help is gladly appreciated!

How does a Bluetooth Socket connection work on Android?

I am new to bluetooth. I understand on Android I can connect to another bluetooth device as a client through a BluetoothSocket connection. How do I handle data that is received? In what format does data get sent from the server to the client?
Going through your questions:
How do I handle data that is received?
The ideal way to handle data is with threads (although it is possible to use a service). A single connected thread running through an infinite loop will attempt to try to read data from the stream that is provided by the socket connection.
In what format does data get sent from the server to the client?
Data is sent from server to client via bytes (specifically arrays of bytes). If you know the type of data being received, there are plenty of functions to convert this data to the desired variable type.
For a complete example of how bluetooth works between devices, I'd highly recommend taking a look at the source of the BluetoothChat Sample application. There's also the Bluetooth overview.

Categories