I have an application in which I want to generate drawing sounds based on input from a Wacom stylus.
So far I am stuck at synchronizing the generated sound to input from the pen. I tried to use both pcmreadcallback and a custom memory buffer. In both cases I started with larger buffer size (to test if everything works) and then reduced the buffer size to minimize latency. However, when using 1000 Hz audio as input I was unable to go below a buffer size of 20 samples, i.e. ~20 ms of latency, without audible artifacts. This is a serious issue for fast strokes as they get registered only after they end. I don’t think the issue is in my pcmreadcallback implementation as one execution takes ~0.4 ns.
I wanted to ask if fmod has some low latency mode. Ideally I would like to be able to directly stream data to fmod at 1000 Hz. Then I could update this data with input from the stylus on the fly.