SIP How to change audio codec
I am new to this field ... I need to create a SIP client for android ... I am piling a demo on the developer site and I created some kind of application that works. Now I need to find a way to change the audio codec ... The default codec is g711 ... how can I change it ??? Can you provide some instruction, code or tutorial ??? Any help is appreciated ... Thanks in advance ... In this class I can't find anything to help me: http://developer.android.com/reference/android/net/sip/package-summary.html
source to share
G711 is actually a different name for the PCM codec, which has 2 compression algorithms (with the same compression rate) known as PCMA and PCMU. These are the most standard and widely used audio codecs, supported ready-to-use from almost any Sip server. They are pretty old and don't offer good compression compared to Speex, for example.
Audio codecs in SIP communications are negotiated in INVITE messages via SDP. Changing the audio codec requires the following steps:
Have an audio codec implementation.
Include (at the application level) this codec in your sip client. High-level speech - you have a network layer (most likely UDP) than a data layer (where you process RTP packets) and SIP messages.
You need a mechanism for connecting RTP packets to the audio codec that you would like to use. On the other hand, you need to use SDP to negotiate audio codecs with all parties.
There are several examples: imsdroid, csipsimple, sipdroid, etc., but they use external sip stack implementations (doubango, mjsip). AFAIK Android sip-stack is not very versatile yet.
source to share
Perhaps you could use the SIP related APIs: android.net.rtp contains the AudioStream, AudioGroup and AudioCodec classes which are easy to use. The last one allows you to choose the codec you want. http://developer.android.com/reference/android/net/rtp/AudioStream.html
Caveat: They were only introduced after Honeycomb, so if you are using it, you can only use devices that have this version installed or later. Considering you're already using android.net.sip (Gingerbread onwards) this shouldn't be a big problem.
source to share