這里列出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/axdc_qa_team/article/details/4271043 (除協議外,非常詳細的文章) http://blog.csdn.net/jay100500/article/details/52955232 (adts協議) http://blog.csdn.net/leixiaohua1020/article/details/11822537 //aac header http://yeyingxian.blog.163.com/blog/static/344712420134485613752/ https://wiki.multimedia.cx/index.php?title=MPEG-4_Audio |
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。