首页 > 其他 > 详细

AAC ADTS流解析总结

时间:2017-08-01 21:36:29      阅读:251      评论:0      收藏:0      [点我收藏+]

这里列出Android里将aac编码器输出的音频帧加上ADTS头的代码:

+ int tmpFd;

+ tmpFd = ::open("/data/src.aac", O_WRONLY | O_APPEND );

+ if ( tmpFd < 0 ) {

+    LOGE("No dump decode file %s",strerror(errno));

+ }

+ else

+ {

+    unsigned char adts_hdr[7] = {0xff, 0xf9, 0x5c, 0x80, 0x00,0x1f, 0xfc};

+

+    adts_hdr[3] = 0x80 | ((mConfig->inputBufferCurrentLength >> 11) & 3);

+    adts_hdr[4] = (mConfig->inputBufferCurrentLength >> 3) & 0xff;

+    adts_hdr[5] = ((mConfig->inputBufferCurrentLength & 7) << 5) | 0x1f;

+

+    ::write(tmpFd,adts_hdr, 7);

+    ::write(tmpFd,(const char *)mConfig->pInputBuffer , mConfig->inputBufferCurrentLength);

+    ::close(tmpFd);

+ }


AAC参考知识:

http://blog.csdn.net/jay100500/article/details/52955232

http://blog.csdn.net/leixiaohua1020/article/details/11822537


本文出自 “专注嵌入式多媒体技术” 博客,请务必保留此出处http://zyg0227.blog.51cto.com/1043164/1952766

AAC ADTS流解析总结

原文:http://zyg0227.blog.51cto.com/1043164/1952766

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!