keijiro / Lasp

Low-latency Audio Signal Processing plugin for Unity
The Unlicense
1.57k stars 121 forks source link

Minimizing latency? #48

Closed jeffhgit closed 2 years ago

jeffhgit commented 2 years ago

I'm wondering if there's a way to minimize latency within LASP. There is still a bit of lag in my response, maybe ~200ms. Are there any alterations I can make to LASP to lower this? Maybe some LASP features or components that I can disable or reduce to cut down on the resource cost/response time? Thank you.

keijiro commented 2 years ago

LASP chooses the buffer size based on the following calculation: max ( 1/60, device driver latency )

https://github.com/keijiro/Lasp/blob/v2/Packages/jp.keijiro.lasp/Runtime/Internal/InputDeviceHandle.cs#L186

So, if your device supports low latency input with the default device driver on your system, it should run with 1/60 sec latency.

keijiro commented 2 years ago

I'm closing this issue now. Please reopen it for further problems.