I need to stream PCM data generated at runtime. So I have a thread with a loop
public void run() {
while(...) {
mAudioTrack.write(getPCM(), ...);
}
}
Unfortunately this doesn't work. It seems it doesn't depend on AudioTrack buffer size. I want it to be very small to simulate sort of low latency behaviour (150 ms) so the user can dinamically change the PCM picked by getPCM()
int bufferSize = 0.150 * sampleRate * channels * bitsPerSample / 8;
However, I tried to increase the buffer size up to 100k with no result
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…