Reputation: 53
I want to set codec G729 default enabled. I searched on StackOverflow and found many deprecated solutions, but now, they are no longer working.
I wrote some temporary (terrible) code that sets a flag every time you start the application. But I would like a normal solution.
Upvotes: 2
Views: 6357
Reputation: 61
Modify the file: linphonerc
[audio_codec_0]
mime=G729
rate=8000
enabled=1
Delete your APP on iPhone or simulator, build and run. You will found codec G729 is enabled.
Upvotes: 3
Reputation: 53
The solution, by Forced ON:
try {
PayloadType ptG729 = LinphoneManager.getLc().findPayloadType("G729");
LinphoneManager.getLc().enablePayloadType(ptG729, true);
} catch (LinphoneCoreException e) {
Log.e(e,"Unable to modify status for codec " + "G729");
}
This code can be added to LinphoneActivity.java for example, to call at the first application start
protected void onCreate(Bundle savedInstanceState) {
...
if (LinphonePreferences.instance().getAccountCount() > 0) {
LinphonePreferences.instance().firstLaunchSuccessful();
} else {
startActivityForResult(new Intent().setClass(this, SetupActivity.class), FIRST_LOGIN_ACTIVITY);
//Forced ON G729
//<<<<<<<<<<<<<<<
}
...
}
Upvotes: 2
Reputation: 43108
To use G729 codec you need:
Upvotes: 2