我需要做一些 EQing 并为 .wav 文件应用数字效果。有没有办法从下面的“缓冲区”中提取单个 PCM 样本值来进行一些 EQ/处理?AudioTrack 是正确的方法吗?
private void playSound() {
audioTrack.play();
double input = 0;
int bufferSize = 512;
byte[] buffer = new byte[bufferSize];
InputStream inputStream = getResources().openRawResource(R.raw.wave);
try {
while((input = inputStream.read(buffer)) != -1)
audioTrack.write(buffer, 0, input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}