抱歉才看到瞎饲,文章里有寫到的:
public static short[] bytes2Shorts(byte[] bytes) {
if (null == bytes) {
return null;
}
short[] shorts = new short[bytes.length / 2];
ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN).asShortBuffer().get(shorts);
return shorts;
}
[Android開發(fā)備忘]關于AudioRecord和AudioTrack的緩沖區(qū)的理解,及避坑指南文檔說明: 關于本人文章的說明[http://www.reibang.com/p/c979196b3d38] 本文檔適合剛接觸安卓錄音開發(fā)的新手,大佬見笑褐捻。 本文檔是本人在...