Author |
|
Jalal Vetran
Joined: April 24 2006 Location: Iran Posts: 188
|
Posted: February 22 2007 at 6:51am | IP Logged
|
|
|
Hi
We want to show Amplitude of both Received and Sent sound data on the Softphone.
Would you please guide me how can I do this. If there were some callback functions to receive both Rx and Tx we have functions to calculate Amplitude of the line.
Thanks
Jalal Abedinejad
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: February 22 2007 at 11:36am | IP Logged
|
|
|
Hi Jalal,
There are a number of ways you could do this. If you want to simply show in a GUI element of the soft phone the "amplitude" of the combined received (Rx) and transmitted (Tx) audio data, the simplest way would be to use the "call recording feature" of the media engine. Once activated, the media engine will pass to your app the digitally mixed Tx and Rx 20Ms audio sample block data of the phone line.
Your app can tell the media engine that it only wants the mixed 20Ms recorded sample blocks. In this case, the media engine will not record the sample blocks to a raw or wave file image. Your app can then do whatever it wants with the 20 Ms sample blocks - like feed them into an algorithm to compute average signal amplitude. Your amplitude computations can then be updated in a volume indicating GUI element.
The C/C++ code would be something like the following:
Code:
// the media engine will call this procedure when it has
// digitally mixed call record sample blocks ready.
//
void PhoneLineRecordCallback(PHONE_LINE_RECORD_DATA *pPhoneLineRecordData)
{
// compute average signal amplitude in this proc and
// post a message to your GUI control.
}
// somewhere in your code after the media engine has been created,
// activate call recording feature.
//
TELEPHONY_RETURN_VALUE status;
.
.
.
status = StartPhoneLineRecording(
// handle to the media engine.
hStateMachine,
// the zero based phone line.
0,
// do not record to a file.
FALSE,
// record to file RAW - ignored.
0,
// record directory - ignored.
0,
// your callback handler.
PhoneLineRecordCallback,
// callback handler instance data.
pUserData
);
if(status != SipSuccess)
{
// handle the error.
}
.
.
.
|
|
|
If on the other hand you would like your app to handle the received and transmitted audio separately, then you will have to use the Rx IVR and Tx IVR elated features. Please see the OpenRxIvrChannel() and OpenTxIvrChannel() API procedures in the VOIP Media Engine Developer's Reference.
Repost as needed,
Support
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: June 21 2007 at 11:34am | IP Logged
|
|
|
Updated Note:
The latest release of the media enigne supports sending VU meter sample block data to the app.
See the SetPhoneLineVuMeterCallback() API procedure in the Software Developers Reference.
Support
|
Back to Top |
|
|
Jalal Vetran
Joined: April 24 2006 Location: Iran Posts: 188
|
Posted: June 24 2007 at 10:53am | IP Logged
|
|
|
I did not get what this new API adds in compare with PHONE_LINE_RECORD_CALLBACK_PROC ?
Would you please explain it for me?
Regards,
Jalal
|
Back to Top |
|
|
support Administrator
Joined: January 26 2005 Location: United States Posts: 1666
|
Posted: June 26 2007 at 8:34am | IP Logged
|
|
|
Hi Jalal,
The VU Meter callback functionality is very close to the record callback functionality. As a matter of fact, the same digitally mixed sample buffer data gets passed back to the app for both callbacks.
The difference in the callbacks is that the VU meter callback functionality is not interrupted when call recording get disabled. When an application registers a VU meter callback for each phone line, the media engine will always give the app digitally mixed phone line data no matter what.
It was added because a large customer stated how annoying it was to have to leave call recording active all the time just to have digitally mixed sample block data coming from a phone line (as per the record callback).
Support
|
Back to Top |
|
|