fdk-aac检查ASC(audio special configure)配置的方法

话不多说,测试代码如下:

#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <stdlib.h>
#include "aacdecoder_lib.h"
#include <iostream>
using namespace std;

int main() {
	HANDLE_AACDECODER handle;
	handle = aacDecoder_Open(TT_MP4_RAW , 1);
	//UCHAR eld_conf[] = { 0xF8, 0xE8, 0x50, 0x00 };//ste eld 44.1k
	//UCHAR ld_conf[] = { 0xBA, 0x88, 0x00, 0x00 };//mono ld 32k
	//UCHAR ld_conf[] = { 0xBA, 0x89, 0x00, 0x00 };//keda mono ld 32k
	//UCHAR ld_conf[] = { 0xB9, 0x90, 0x00, 0x00};//hisi ste ld 48k
	//UCHAR ld_conf[] = { 0x11, 0x90};//hisi ste lc 48k
	UCHAR ld_conf[] = { 0x12, 0x90};//hisi ste lc 32k
	UCHAR *conf[1] = { ld_conf };
	static UINT conf_len = sizeof(conf);
	AAC_DECODER_ERROR err = aacDecoder_ConfigRaw(handle, conf, &conf_len);
	if(err>0)
		cout<<"conf err:"<<err<<endl;

	CStreamInfo *info = aacDecoder_GetStreamInfo(handle);
	cout<<"info->aacSampleRate:"<<info->aacSampleRate<<endl;
	cout<<"info->channelConfig:"<<info->channelConfig<<endl;
	cout<<"info->aot:"<<info->aot<<endl;
	aacDecoder_Close(handle);
	return 0;
}

其中sample rate是采样率,channel config是通道数,如果是立体声则是2,aot是类型,aac-lc是2,aac-ld是23,aac-eld是39

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值