Voice connection between two points

11

I would like to study about, read how it is done and all possible details about making voice calls between two points A and B

It also works these links between users like viber, WhatsApp, facebook provide.

Is it possible to use PHP HTML5 JavaScript?

    
asked by anonymous 17.02.2015 / 03:49

2 answers

5

About PHP:

I'm not going to say that it's impossible to do PHP, but maybe it's a hard way, because something will need to capture the audio of the people at the conference, save the data in the documents, and the people who have been in the conference wait for new bytes to be added to the server, this can be very costly to develop and for the server .

About HTML5 or JavaScript API:

Natively it is not possible to stream communication, you will need a specific plugin.

  

Note: Google Chrome Canary (for developers) already supports this

As the response from SOen some technologies are being developed, but have not been implemented and will probably be slow to implement due to the (I am referring to HTML / JavaScript integrating so many "diversified" features that I had not previously imagined being anything "native"):

link

    
17.02.2015 / 04:16
1

Any language that supports socket can be used to transmit voice, some have more ease than others.

In general, the applications you mentioned have a central server that serves as a relay point for clients, "what is it necessary for?"

Security - Clients do not need to have an open port on the PC facing the internet, imagine you having to do port redirection and nat configuration if you are behind a router.

Control - What if one of these companies legally needs to Spy / listen / staple a user? this is only possible if there is a level of control, in these cases the transmissions need to pass through the central server, another type of control would be to recode the audio in codecs to consume the smallest possible band, not send transmission during the connection in case of silence in one sides to once again save bandwidth, etc.

The architecture is simple:

Client (A) < ------ > SERVER < ------ > Customer (B)

The server itself needs to have one or several ports open to the internet (usually UDP ports) so that clients can connect, then this central server will undoubtedly need to develop in some language (java, php, perl, python, C, etc), the central core needs to be in line on the ports defined by you, must be able to support multiple concurrent connections on the same port concurrently / threads ie it must be able to perform multiple tasks simultaneously multiple customer connections happening at the same time). The server is responsible for receiving voice frames on the client side and forwarding to CustomerB.

Clients should be able to close socket communication with the server (connect to the server) and transmit the voice blocks captured by the microphone into a fixed-size buffer (2048, 4096, etc.), so data is output via socket from clientA to the central server that forwards this transmission to clientB.

This is the basic idea behind any voice connection made under IP, of course there are ways to refine and improve the process such as trying to take the central server a little load and let the audio encoding / decoding to be done in the customer.

You may have noticed that working with socket your server does not need to be written in the same language as the clients.

You can get out of the concept and try to write the basics without having a central server, to start a peer-to-peer communication on an internal network and because you did not see the internet, all you will need for these steps is to make both IPs connect directly via socket, start sending text as a chat, your next step will be to send audio through the buffer, instead of text you may want to try sending an array in float point to be coded and touched while receiving the frames through the socket on customerB.

    
17.02.2015 / 23:14