Voice link between two points

Asked

Viewed 992 times

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

Similar works these links between users like Viber, Whatsapp, facebook provide.

It is possible using PHP HTML5 Javascript ?

2 answers

5

About PHP:

I’m not going to say that it’s impossible to do PHP, but maybe it’s a tough path, because it’s going to take something to capture the audio of people in the conference, save this data in documents and people in the conference are waiting for new bytes to be added to the server, this can be very costly to develop and to the server.

About HTML5 or Javascript API:

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

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

As this response from Soen some technologies are being developed, but have not been implemented and will probably take time to implement due to the difficulties, since they are things considered very "new" (I refer to HTML/Javascript integrating so many "diversified" functionalities that before it was not imagined to be something "native"):

http://www.adobe.com/products/adobe-media-server-family.html

  • 3

    "[PHP] is not a technology recommended for data transmission of the genre (Streaming)" - why? If you do not quote the reason(s) (s) it seems that it is only your opinion.

  • @Andréribeiro Thanks for the comment, I got it. I edited the reply, tell me if it is acceptable now. Thanks again.

  • Good answer! But we would use PHP to stream type with websockets

  • @Gabrielhenrique It would be very costly for the server to do such a process, unless you want to transmit the "addresses only". You may be able to use PHP for this, but probably your server won’t last a day.

  • By giving a negative vote please justify, I will not be upset, I just wish to know where I can improve.

  • 1

    @Guilhermenascimento Very good. + 1 to repair the negative for no reason you were given.

Show 1 more comment

1

Any language that supports socket can be used to transmit voice, some have greater ease other not so much.

In general, the applications mentioned by you have a central server that works as a relay point for clients, "so this is necessary ?"

Security - Customers do not need to have an open port on the PC face to the internet, imagine you have to do port forwarding and Nat configuration if you are behind a router.

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

The architecture is simple:

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

The Server yes needs to have one or several open doors facing the internet (generally UDP ports) for clients to be able to connect, so arguably in this central server you will need to develop in some language (java, php, perl, python, C, etc), the central core needs to be listed on the ports defined by you, should be able to support multiple simultaneous connections on the same port concurrently/threads or whether it should be able to perform multiple tasks simultaneously (calls from multiple customers happening at the same time). Server is responsible for receiving voice frames on the customer sideA and forwarding to Clienteb

Clients must be able to close socket communication with the server (connect to the server) and transmit the voice blocks captured by the microphone in a fixed size buffer (2048, 4096, etc.), this way the data leaves via customer socketA to the central server that forwards this transmission to the customer.

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

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

You can get out of the concept and try to write the basics without having a central server, to initiate a point-to-point communication on an internal network and because not via the internet, all you will need for these steps is to make both Ips connect directly by socket, start by sending text equal to 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 encoded and played while receiving the frames by the socket in the clienteB.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.