I play back sound with Java's SourceDataLine but whenever I try to adjust the volume (gain), there is a 0.2-0.5 second delay between the action and the response in the speaker. The audio data is written in 4k-16k chunks (16bit mono, 22kHz ~ 44k/s).
How can I make this volume adjustment more real-time?
Does the write(byte[], int, int)
lock out the gain adjustment of the FloatControl?
Do I need to revert back to a DSP way of concurrent adjustment of the sound buffer data volume or submit smaller chunks?
JDK7, Decent Windows PC