topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 10:34 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Implementing VoIP to a simple program...  (Read 9751 times)

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Implementing VoIP to a simple program...
« on: November 09, 2007, 02:16 PM »
Alright, so here is what I need to do:

I moved off to college and want to program a piece of software (nothing big), that will be able to take advantage of VoIP so I can talk to my parents at home. I am familiar with Delphi/C++ but would be willing to learn something new.

Is there a component/plugin I could buy for my IDE (Borland Developer Studio 2006/2007) that allows VoIP? If so, is it cheap and efficient? If not, could I program my own component to do the job? I don't even know where to start, but I do know that I want to make this software work.

Thanks for your time,
-CodeByer
CodeByter.com - http://www.codebyter.com

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #1 on: November 09, 2007, 05:17 PM »
There are some voip components for delphi/bcb and activex, but i don't have any experience with them:

http://www.vclcompon.../catalog/Delphi_Voip
http://www.torry.net/pages.php?id=207

I'd think hard about coding your own vs using an existing free tool, unless you really want to learn how to make such programs.

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #2 on: November 09, 2007, 06:38 PM »
I was looking into developing this application to get a preview of how it works. I wouldn't mind using a tool if I can implement it the same way I would a component, but I would like to develop my own with the help of a 3rd party component/tool.
CodeByter.com - http://www.codebyter.com

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #3 on: November 09, 2007, 06:48 PM »
I think you'd be better off looking for a freeware VOIP programs, or sucking it down and using skype... VOIP isn't a trivial thing to program if you want it to be more than a toy to be used on a LAN.
- carpe noctem

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #4 on: November 13, 2007, 09:07 PM »
Here is the Problem:
-If I was using a LAN, then it would be fine. I need to develop an application P2P or not to allow my father and I to talk using UDP (for lower latency and such.)
-I have researched multiple things concerning the VoIP capabilities and while using a component sounds best, I would like to implement this coding into an application of my own so that when I work on my 2D video game project, I will understand how to write the coding for the VoIP option I am looking to implement.
-I have looked into several different ways on how to do this but they all seem a bit over my head at the moment. Being in college, I have all the time in the world to learn things... Even if it means learning a new language...
-Most importantly, I have the ability to setup a protected server with a static IP address to host the server application that will be used to run this VoIP project.
-It doesn't need to be complex, it just needs to be able to hold a connection and transmit packets with the ability to skip a few here and there.

I know I need to use a Sound Codec, like Speex, and some network packet buffering code, but I need a little bit more to bite on. If someone would be willing to learn/help me with the project, that would be cool! It's something i've been looking to learn for a couple years now.
CodeByter.com - http://www.codebyter.com

hwtan

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 73
    • View Profile
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #5 on: November 14, 2007, 07:39 AM »
What you probably means is to implement transmission of voice packet using ip packets, not VoIP which covers more than just that (SIP and all).

Basically, you will need some way to capture digitialized packets from the sound device and some way to regenerate received packets on the sound device. May be you might want to read up on DirectX (DirectSound). There is a project on CodeProject on this (http://www.codeproje...net/VoIP_For_You.asp). For the network packet, the challenge is in the data compression and how to optimising/adjust the buffer size such that you are able to tolerate some form of jitter in the receive rate and yet acceptable latency over different network due to their bandwidth and latency characteristics.


Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #6 on: November 14, 2007, 05:36 PM »
Perfect! That is EXACTLY what I need! Thank you, thank you, thank you, thank you! lol! I am going to read up on it some more and then begin "toying" with things! I'll reply later with any questions/comments! Thanks again, Ethan!
CodeByter.com - http://www.codebyter.com

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #7 on: November 26, 2007, 07:51 AM »
EDIT: June 30th, 2008

Alright, so... Here is my new understanding of what needs to be accomplished.. There will be no VoIP involved but rather the transmission of voice packets (recorded to a filestream using the MCI device or waveIn(), etc...) through a TClientSocket and TServerClient. While i've made tremendous progress on understanding the process of how this works, i'm still stuck because I cannot implement exactly what I need..

Here is what I'm looking to develop:

Client Form
--------------------------------
-Holds a simple TClientSocket that will maintain an active connection with the server. The audio that is captured to the filestream needs to be sent over this socket as well as received from this socket too.
-This form will have a hotkey (like the 'CTRL' button) which, when held down, will record a wave file to a stream. When the hotkey is let go, that wave stream is complete but not deleted. While the wave audio is being recorded when the button is held down, it also needs to be put into buffers and sent through the TClientSocket component. When the button is pressed again, the wave stream simply starts over and repeats the SendStream process

Server Form
--------------------------------
-Acts the same as the Client form but is classified as the server simply because it holds the Active Connection.

I really don't care about encryption/decryption or compression/decompression. The wave stream will take on the GSM 6.0 Audio Format so that the wave file is only writing 1kbps and still maintains audio quality... To be honest, it really doesnt matter what form the wave takes as long as it can be streamed through the Socket at a fast rate.

Logically speaking, it will do this:
1. Ctrl button is pushed
2. Application creates a new wave file stream
3. Application records to the wave file stream
4. Application transmits buffers of size X through the Socket as the wave file stream is being recorded.
5. The receiving application realizes that the Sender is sending a streamed wave file, so it opens a wave file stream that can be read to for playback when all the voice packets have been received.
6. The application then waits for the ctrl button to be pressed again so that it can repeat the same process over and over until the Socket is closed.

This is where I am at.. I've researched alot of things using MSDN Microsoft, but cannot put together what I need for this to work.

On the form, the only thing i really need is a "Record" and "Stop" button for now, everything else is already preset (like the server info for the TClientSocket, etc)... If any of you masterminds understand how to do what i'm talking about, and wouldnt mind helping with the coding behind it, I would be more-than thankful because it seems like everyone points me to a component, which I have nothing against but i'd rather learn how to do this through sample coding so that I get a good grasp of how this works programatically... its not that hard to do, I just dont have experience with the 2 fundamental parts of this project: 1) recording to a file stream with MCI or something, and then 2) streaming/receiving this through the TClientSocket... Please help if you can, some sample source would be amazing! im using CodeGear Rad Studio but I can try to look through Delphi coding or something similiar..
CodeByter.com - http://www.codebyter.com
« Last Edit: June 30, 2008, 10:29 PM by Codebyte »

Codebyte

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 160
  • "Premature Optimization is the root of all evil."
    • View Profile
    • CodeByter.com
    • Donate to Member
Re: Implementing VoIP to a simple program...
« Reply #8 on: June 30, 2008, 10:30 PM »
/bump for the post above since all I did was replace what I had there and it didnt update the post

p.s. - i'm so close that I can taste it... just need someone to help me over the hill.
p.s.s. - just realized, i've worked on this dumb project for around 1 year now... off and on, ugh!
CodeByter.com - http://www.codebyter.com
« Last Edit: June 30, 2008, 10:32 PM by Codebyte »