Audio latency is the delay between the time an application submits a buffer of audio data to the APIs, until the time that it is heard. On the other hand, not confused the UI latency which is the time between a user’s tap or click on the screen and the processing event on the software side.
The UI latency origin can be mitigated with the new Unity input system or the OnPointerDown interface as with the MPTK demo EuclideanRhythm (full source available with the Maestro Pro). See bellow APK demos description and download.
Luckily, to mitigate the latency on the hardware there is others solutions.
First Option: Audio Library with Oboe and MPTK Pro
The default audio engine for Unity is FMOD. It’s a powerful engine with a lot of features, well tested on many hardware but too general for efficiency. However, use this Unity default audio engine if latency is not crucial for your creation.
If you need good latency, use Oboe instead.. On the other hand, Oboe replaces the default Unity audio engine. Android is used by a great number of different hardware, it is impossible to guarantee a good sound on each.
How to use Oboe with your MPTK application ?
- Recommended Unity version: 2021.3 and above.
- Create a new Unity project.
- Download and import in your project Oboe (version tested:1.6.2) from here.
- Download and import in your project Maestro Pro from here.
- Go to Unity menu Edit → Project Settings → Player
- add symbol UNITY_OBOE
- allow unsafe code

- Build and deploy your APK and that’s all folks!!! MPTK has automatically switched to the Oboe audio engine.
Some drawbacks (world is not perfect!)
- The Unity Audio Source are no more used also Unity effects and 3D sound are disabled but these functions are working:
- Panning left/right is already available
- MPTK effects are working as usual (low pass filter, reverb, chorus).
- MPTK synthesizer voices effects are working (ADSR, LFO, Pitch, …)
- Oboe is working only on Android.
- A lot of different devices are using Android, It’s not possible to check all the smartphone and tablet hardware. You could have to adapt some setting depending on the device like sample rate and buffer size. We can’t commit on best music experience on all devices. You could try the demo (see below).
- The latency with Unity is not only due to the audio engine. Also, search how to reduce input latency. But for this point, MPTK and OBOE can do nothing, Sorry!
In addition, you can going to the forum if you have question.
Second Option: Modify Unity Audio properties
According to your need, you could have only to change some properties on the Unity setting to resolve your latency issue.
From Unity menu Edit → Project Settings → Audio

- Set DSP Buffer size to Best latency
- Try with higher Sample Rate
- Minimize audio effects as much as possible
You can also change these parameters from the MPTK prefab inspectors.
Tips:
- Audio latency is not a specific issue with Android but also on Windows, IOs, Mac, … Obviously, these setting are useful also for them.
- Depending on your system, a too low buffer size can generate weird sound with with some material.
- Also, forget Bluetooth headset because of a high latency (for now) !
Demo
APK demos are available for those who want to test on their Android: APK for Euclidean Rhythm demo. Demo are build with or without Oboe. The No Oboe with a 128 bits buffer size provides a good latency but could produces weird sound on some hardware.
Of course, I would be very happy to have your return.
This demo is useful to test latency but also the MPTK synthesizer voices run time effects and running different players at the same time. So, there is two prefabs MidiStreamPlayer for the drums and one MidiFilePlayer for the midi running at the same time.