Android linephone-android sdk设置语音编码问题

1.遇到的问题

今天遇到linphone-android sdk需要解决语音编码问题,需要指定编码。查了下配置,里面没有发现类似的配置。

Start of factory rc

This file shall not contain path referencing package name, in order to be portable when app is renamed.

Paths to resources must be set from LinphoneManager, after creating LinphoneCore.

net

mtu=1300

force_ice_disablement=0

sip

guess_hostname=1

register_only_when_network_is_up=1

auto_net_state_mon=1

auto_answer_replacing_calls=1

ping_with_options=0

use_cpim=1

sound

#remove this property for any application that is not Linphone public version itself

ec_calibrator_cool_tones=1

video

displaytype=MSAndroidTextureDisplay

auto_resize_preview_to_keep_ratio=1

misc

enable_basic_to_client_group_chat_room_migration=0

enable_simple_group_chat_message_state=0

aggregate_imdn=1

notify_each_friend_individually_when_presence_received=0

app

activation_code_length=4

prefer_basic_chat_room=1

assistant

xmlrpc_url=https://subscribe.linphone.org:444/wizard.php

lime

lime_update_threshold=-1

End of factory rc

2.解决方法

  • 查看linphone安卓端支持的编码
  • 查到一个指定编码的方式,之后试了下是可以的
  • 根据自己的需要调整参数

    //音频部分, 这里增加了一个遍历, 用于设置指定的音频格式.
    //h264, no VP8 fixed outgoing call no video.
    //音频部分, 这里增加了一个遍历, 用于设置指定的音频格式.
    //h264, no VP8 fixed outgoing call no video.
    val payloads: Array = core.audioPayloadTypes
    for (i in payloads.indices) {
    //Payload:null, VP8/90000/0, A VP8 video encoder using libvpx library., VP8
    //Payload:profile-level-id=42801F, H264/90000/0, A H264 encoder based on MediaCodec API., H264
    val pt: PayloadType = payloads[i]
    //判断是否指定的音频格式.我这里指定PCMA格式
    val goodPayload: Boolean = "PCMA" == pt.mimeType
    pt.enable(goodPayload)
    }

相关推荐
Htr_1 小时前
Creem 2.0 使用指南:面向 AI 构建时代的资金平台
android·数据库·人工智能·ui·photoshop
wardenlzr2 小时前
车机看门狗(Watchdog)为何会让整机硬重启
android·优化·车机
IT毕设实战小研3 小时前
基于大数据的商场商铺数据分析与可视化的设计与实现
android·java·大数据·django·课程设计
aqi003 小时前
一文读懂 HarmonyOS 7.0 带来的十大API重要升级
android·华为·harmonyos·鸿蒙·harmony
是店小二呀4 小时前
鸿蒙PC开源移植:CodeLite原生IDE与Remote Agent适配
android·智能手机·远程桌面
终端安全笔记5 小时前
iOS 27 给了租赁一个新工具,但它只认受监督的设备
android·网络·安全·ios
爱笑鱼5 小时前
Android 系统启动机制(八):系统服务怎样从创建走到可用?SystemServiceManager 和 Boot Phase 各管什么?
android
hai_android5 小时前
Android 组件化开发实践
android·java·kotlin
mmsx5 小时前
Android 几何构造器的双栈机:链式 API 底层是怎么装配几何的
android