Algorithm
For a near real time effect, consideration of speed has been of paramount importance. This prohibits writing of any sound sample on to the Hard Disk in the different formats normally used.
When the application is launched, the in built server switches on and waits for a connection request.
Calling Computer |
Called Computer |
Initializes the connection by keying the IP address of the called computer in the Connect Dialog Box. This sends a 'Request Connection' message. On 'Declined Connection', the client resets. On 'Accepted Connection', the server receives the 'Initiating Second Connection' from the called computer. This connection is accepted automatically and sends a 'Second Connection Accepted' message to the called computer. This completes the connection between the appropriate servers & clients at each end. Now the Application intimates the user to 'Wait for Host to reply', opens the Audio device for playback and intimates the user that the device is ready for playback. As & when the client receives the voiced packets, they are prepared and playedback. On receipt of the check message, the application stops the playback, closes the audio device for playback and opens it for recording. |
Upon receiving the 'Request Connection' message, the user can either accept or reject the connection. On Rejection, the server sends a 'Declined Connection' message and resets. On Acceptance, the server sends a "Accepted Connection' message and initiates a second connection 'Initiating Second Connection' through his client with the calling computer. Once the client receives the 'Second Connection Accepted' message, the application opens the audio device for recording and intimates the user to begin talking. The voiced buffers are then sent to the Calling computer. On detection of silent buffers by the squelch() function, the application stops the recording, closes the device and opens audio device for playback. The server sends a check message indicating that recording has stopped. |
This process of recording and playback continues at both ends until the user terminates the connection. This closes the audio devices from their respective modes, closes the client and sets servers running to wait for fresh connection. |
Squelch
This application was built with the assumption that the user is using a half-duplex sound card. Thus, to shift between recording and playback, a function called Squelch() is used. At the recording side, as & when the buffers are filled with recorded voice, they are passed through the Squelch() function. The primary work of the squelch () function is to check each buffer for the data it contains, to differentiate between voiced buffer and silent buffer. This function keeps a check of the silent buffers. As it encounters 14 consecutive silent buffers, it will intimate the application to stop the recording and start the playback.
The graph below shows the operation of the Squelch Function
The value of the squlech generated, varies with the average amplitude. However, on the twentieth consecutive buffer, where the Average Amplitude is more than the Seuelch, the application recognises this buffer as the point to switch from recording to playback mode.
As seen in the above graph, at the 137th buffer, the Average Amplitude rises above Squelch and rides above Squelch continiously for the next 20 buffers. This is seen by the Application as silence and uses it to switch from recording to playback mode.
Topics : MAIN PAGE
INTRODUCTION TO THE APPLICATION
ABOUT THE APPLICATION
TOOLS USED
MINIMUM SYSTEM REQUIREMENTS
UPGRADATION POSSIBLE
DEVELOPED BY
VIEW AND DOWNLOAD THE SOURCE CODE