Re: Sipxtapi-Recording Issue

42 views
Skip to first unread message

Daniel Petrie

unread,
Nov 22, 2013, 8:21:22 AM11/22/13
to sujay gajula, si...@googlegroups.com
Hi Sujay:
Sure, its possible to add code to encode the audio for recording.  We currently use PCM as it is the least CPU expensive as everything process in PCM inside the media subsystem.  This gives us the best scalability when we are dealing with many calls at a time.

It is not unreasonable to have an application that has the goal of optimizing something other than call density.  We already have a encoding framework.  Potentially we can use an existing media resource or component.  I would start by understanding the media resources and media subsystem architecture:

You should join the email list as this discussion should occur on the list:

The MprRecorder is the resource that records audio to a file:

I guess, I would start by defining the requirements.  You want to minimize the recorded file size.  There are certainly other options such as Speex and ILBC that might provide less loss.  The other big question here is what file format do you want or need?  Currently the PCM is recorded in a raw file format with no header or encoding description.  Is that what you want or do you want something that can be exported and played in other applications?

Cheers,
Dan




On Friday, November 22, 2013 2:50 AM, sujay gajula <gajula...@gmail.com> wrote:
Hi Daniel,
              I am currently developing a soft phone for which i am using sipxtapi as sip, rtp provider. I have a small issue in recording. Currently the sipxmedialib is recording the call in PCM mode which is too much size for the final recording. So i would like to know weather we can record the call in GSM format . Daniel Pocock gave me your name and asked me to consult with you. If you can guide me in this it will be very helpful. This is my first time working with sipxtapi , if my question seems silly please bear with me.

Regards,
G.Sujay.


sujay gajula

unread,
Nov 22, 2013, 8:40:56 AM11/22/13
to si...@googlegroups.com, sujay gajula, Daniel Petrie
Hi Dan,
          Yes Dan my requirement is to record files in such a way that it will occupy less space. Since the gsm encodes into less file size i would like to have sipxtapi to record the file not in PCM raw but in any other format(gsm/ilbc/speex) which will occupy less space. I am not worried of quality here only concern is file size. So if this sort of feature is already there in sipxtapi let me know. Also the recorded files should be played through Windows Media Player .

Regards,
G.Sujay. 

Daniel Petrie

unread,
Nov 22, 2013, 10:15:17 AM11/22/13
to si...@googlegroups.com, sujay gajula
Hi Sujay:
If you want to be able to play the file in the Windows Media player, you probably need to create Wave files.  I am not a Window person.  So I am not sure what codecs the Windows Media player supports for Wave files.  I would start there and determine what your codec options are.  Then we can compare that with the list of codecs already supported in sipX.  There is some code for creating Wave files in sipX.  I am not sure how well maintained it is or how robust it is.  We can look at that after we know what codec(s) will work with the Windows Media player.

Cheers,
Dan


--
You received this message because you are subscribed to the Google Groups "sipX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sipx+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out
.


sujay gajula

unread,
Nov 22, 2013, 10:23:45 AM11/22/13
to si...@googlegroups.com, sujay gajula, Daniel Petrie
Hi Dan,
        Ok Dan Got your point, i see sipxtapi has libgsm library code. So can we use that in any way so that the recording goes on in gsm format that would help the cause of reducing file size.Can you take a look at this thing and let me know.

Regards,
G.Sujay.

Daniel Petrie

unread,
Nov 25, 2013, 11:54:30 AM11/25/13
to si...@googlegroups.com, sujay gajula
Hi Sujay:
As a first step, I would build the unit test: CpPhoneMediaInterfaceTest and verify that it is working correctly in your environment.  I  checked in a minor fix on Friday that resolves a build problem on MSVC8+.  So it should build for you if you update from svn.  Run the test and make sure it is properly recording and creating wav files (PCM encoded).  In the mean time I will take a look at the recording resource and take a pass at what need to be changed and added.

Cheers,
Dan

Daniel Petrie

unread,
Nov 25, 2013, 11:44:12 PM11/25/13
to sujay gajula, si...@googlegroups.com
Hi Sujay:
I took a pass at coding support for recording to files with GSM encoding.  I checked in MprRecorder with the changes.  I only tested it enough to verify that it still works for wave files using PCM.  So the GSM part needs testing and most likely debugging.  To enable GSM you will need the following patch.

Note that I did not make any changes to add support for reading wave files with GSM encoding, only for writing.

Cheers,
Dan


Index: sipXmediaMediaProcessing/src/CpTopologyGraphInterface.cpp
===================================================================
--- sipXmediaMediaProcessing/src/CpTopologyGraphInterface.cpp   (revision 12183)

+++ sipXmediaMediaProcessing/src/CpTopologyGraphInterface.cpp   (working copy)
@@ -63,6 +63,8 @@
 // CONSTANTS
 #define MINIMUM_DTMF_LENGTH 60
 #define MAX_RTP_PORTS 1000
+//#define WAV_FILE_ENCODING MprRecorder::WAV_PCM_16
+#define WAV_FILE_ENCODING MprRecorder::WAV_GSM

 //#define TEST_PRINT

@@ -1935,7 +1939,7 @@
       stat = MprRecorder::startFile(DEFAULT_RECORDER_RESOURCE_NAME,
                                     *mpTopologyGraph->getMsgQ(),
                                     szFile,
-                                    MprRecorder::WAV_PCM_16);
+                                    WAV_FILE_ENCODING);
    }
    return stat;

sujay gajula

unread,
Nov 28, 2013, 10:35:51 AM11/28/13
to si...@googlegroups.com, sujay gajula, Daniel Petrie
Hi Dan,
            Thanks for your reply. We are making the respective changes to the code and will get back to you on the status.

Regards,
G.Sujay.

Daniel Petrie

unread,
Nov 29, 2013, 1:02:37 PM11/29/13
to si...@googlegroups.com, sujay gajula
Hi Sujay:
I just checked in 3 fixes for support of GSM encoding of WAVE files.  I am not sure if it is working yet, but it should get you closer.  I suspect that there may be a few more tweeks needed to get the WAVE RIFF header correct for GSM.  If you know what additional changes are needed to the RIFF chunk, it should be trivial to make the changes.

Cheers,
Dan


sujay gajula

unread,
Dec 17, 2013, 9:24:32 AM12/17/13
to si...@googlegroups.com, sujay gajula, Daniel Petrie
Hi Dan,
         I am very thankful to you for your continuous support. It worked like a charm . Really appreciate it. In future for any testing or any feature need a fix you can count on me Dan.

Regards,
G.Sujay.

Daniel Petrie

unread,
Dec 17, 2013, 11:20:01 AM12/17/13
to si...@googlegroups.com, sujay gajula
Hi Suhay:
Thank you for using sipX and helping to test.

Cheers,
Dan


Reply all
Reply to author
Forward
0 new messages