I want to start coding a simple Voip application that will help me to talk with a friend of mine. Like Skyp.
I search to the internet and found some useful links like this
It looks good. What you say ?
Ohh i forget to say that i m thinking write this app in C. Whats your opinion ? Do you prefer any other language for this work ? Is a good choice?
Also if someone has ever tried something like this , please tell me your experience. How to start up ,if there is a good tutorial, what language to use and any other useful info.
Thanks for your time.
OK, writing a simple VOIP program as a learning experience is certainly a good enough reason.
First, you should pick a suitable audio codec and learn to use it. I'd recommend SPEEX.
Second, you need to decide how you're going to be sending the encoded data over the network. A simple TCP socket could work, at least with the right options (I'm thinking particularly of TCP_NODELAY
here), but most VOIP applications seem to use UDP to transmit the packets directly, trading reliability for efficiency. So you should learn how to set up and use UDP sockets.
Of course, you also need to learn how to read and play back audio. The details of this will depend on the language and platform you're using.
Once you've got a handle on all that, it should be pretty straightforward. Read audio from the microphone, encode it, send it out over the network, read incoming data from network, decode, play. Of course, you have do several of these things at the same time — it's no good if your program stops sending out your voice while it's waiting for incoming data that may or may not arrive.
One way to handle this could be to split the program into two threads: one for listening and transmission and another for receiving and playback. Another solution would be to use non-blocking I/O and event-driven programming to handle data from multiple sources as it arrives. One possible advantage of this option is that it might make it easier to implement conference calls, where you send and receive audio from multiple people.
Of course, I've never tried this myself, so I'm really just guessing here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With