【Android开发】
[硬解码aac流时需要注意bytebuffer缓冲区直接使用put(byte )会使缓冲区位置改变,从而导致解码aac不成功,正确代码如下:“ bytes.position(0); 为重点,将索引值重置”
ByteBuffer bytes = ByteBuffer.allocate(2);
bytes.put((byte) 0x11);
bytes.put((byte) 0x88);
bytes.position(0);
audioFormat.setByteBuffer("csd-0", bytes);]()