【Android音视频开发】OPenSL ES介绍

简单来说OpenSL ES是一个嵌入式、跨平台、免费的、音频 处理库。

 

Android OPenSL ES库位置:

使用 OPenSL ES 流程:

1、创建接口对象

2、设置混音器

3、创建播放器(录音器)

4、设置缓冲队列和回调函数

5、设置播放状态

6、启动回调函数 

重要接口解释

1、类接口:

SLObjectItf 通过SLObjectItf接口类我们可以创建所需要的各种类型的类接口,比如:

创建引擎接口对象:SLObjectItf engineObject

创建混音器接口对象:SLObjectItf outputMixObject

创建播放器接口对象:SLObjectItf playerObject

2、具体的接口类

引擎:SLEngineItf

播放器:SLPlayItf

声音控制器:SLVolumeItf等等

创建三部曲

如:创建引擎接口对象( createrealizeget )
 

SLObjectItf engineObject = NULL;//用SLObjectItf声明引擎接口对象  
SLEngineItf engineEngine = NULL;//声明具体的引擎对象实例  
void createEngine()   {      
	SLresult result;//返回结果      
	//第一步:创建引擎     
	result = slCreateEngine(&engineObject, 0, NULL, 0, NULL, NULL);     
	//第二步:实现(Realize)engineObject接口对象     
	result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);     //第三部:通过engineObject的GetInterface方法初始化engineEngine     
	result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine); 
}

销毁

(*engineObject)->Destroy(engineObject);

Table of Contents PART 1: USER MANUAL ......................................................................................... 1 1 OVERVIEW ..................................................................................................... 2 2 FEATURES AND PROFILES .............................................................................. 9 3 DESIGN OVERVIEW ...................................................................................... 14 FUNCTIONAL OVERVIEW .............................................................................. 30 PART 2: API REFERENCE ..................................................................................... 60 5 BASE TYPES AND UNITS ............................................................................... 61 6 FUNCTIONS .................................................................................................. 64 7 OBJECT DEFINITIONS .................................................................................. 67 8 INTERFACE DEFINITIONS ............................................................................ 93 9 MACROS AND TYPEDEFS............................................................................. 439 PART 3: APPENDICES ........................................................................................ 501 APPENDIX A: REFERENCES ............................................................................... 502 APPENDIX B: SAMPLE CODE.............................................................................. 504 APPENDIX C: USE CASE SAMPLE CODE .............................................................. 555 APPENDIX D: OBJECT-INTERFACE MAPPING..................................................... 585
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值