当前位置: 首页 > news >正文

Android linphone-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<PayloadType> = 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., H264val pt: PayloadType = payloads[i]//判断是否指定的音频格式.我这里指定PCMA格式val goodPayload: Boolean = "PCMA" == pt.mimeTypept.enable(goodPayload)
}

http://www.lryc.cn/news/276249.html

相关文章:

  • Hyperledger Fabric Orderer 配置解析
  • 苹果电脑交互式原型设计软件Axure RP 9 mac特色介绍
  • Java 判断实体类对象的全部属性是否空
  • Vue3-44-Pinia- 安装步骤
  • L1-005 考试座位号(Java)
  • HDFS概述
  • Hive 的 安装与部署
  • 【HBase】——优化
  • 什么是跨域以及怎么处理跨域问题
  • 【Linux Shell】11. 输入/输出 重定向
  • 数据库-简单表的操作And查看表的结构
  • <设计模式修炼>模板方法模式的使用场景和注意事项学习
  • android 分享文件
  • UE5 C++(十一)— 碰撞检测
  • 时序数据库InfluxDB、TimeScaleDB简介
  • 复试 || 就业day05(2024.01.08)项目一
  • 基于商品列表的拖拽排序后端实现
  • 小游戏实战丨基于PyGame的贪吃蛇小游戏
  • AOP(面向切面编程)基于XML方式配置
  • 多线程的概念
  • DeepPurpose 生物化学深度学习库;蛋白靶点小分子药物对接亲和力预测虚拟筛选
  • Java实现责任链模式
  • rabbitmq延时队列相关配置
  • 【工具】推荐一个好用的代码画图工具
  • Leetcode14-判断句子是否为全字母句(1832)
  • HTTP和TCP代理原理及实现,主要是理解
  • MySQL中的连接池
  • css计时器 animation实现计时器延时器
  • 【win11 绕过TPM CPU硬件限制安装】
  • k8s的yaml文件中的kind类型都有哪些?(清单版本)