AudioDemo icon indicating copy to clipboard operation
AudioDemo copied to clipboard

从FileInputStream读取数据,判断多余.

Open runhwguo opened this issue 5 years ago • 0 comments

byte[] tempBuffer = new byte[bufferSize]; int readCount = 0; while (dis.available() > 0) { readCount = dis.read(tempBuffer); if (readCount == AudioTrack.ERROR_INVALID_OPERATION || readCount == AudioTrack.ERROR_BAD_VALUE) { continue; } if (readCount != 0 && readCount != -1) { audioTrack.play(); audioTrack.write(tempBuffer, 0, readCount); } }

readCount不需要跟ERROR_INVALID_OPERATION/ERROR_BAD_VALUE比较吧

runhwguo avatar Apr 27 '19 18:04 runhwguo