//将16位pcm数据转换成8位有符号的pcmio
byte[] readBuffer = new byte[4096];
byte[] sendBuffer = new byte[readBuffer.length / 2];
for (int i = 0; i
if ((readBuffer[i + 1] & 0x80) == 0x80) {
sendBuffer[i / 2] = (byte) (readBuffer[i + 1] & 0x7f);
} else {
sendBuffer[i / 2] = (byte) (readBuffer[i + 1] + 0x80);
}数据
}di
//将8位有符号的的pcm数据转换成16位new
byte[] readBuffer = new byte[4096]; int audioDataLen = readBuffer.length * 2; byte[] audioBuffer = new byte[readBuffer.length * 2]; for (int i = 0; i