wchc
March 6, 2026, 9:48am
3
It seems to be a general problem with the current audio driver that might be resolved with this proposal:
opened 01:36AM - 26 Feb 21 UTC
topic:audio
platform:android
### Describe the project you are working on
Godot Audio on Android
### Des… cribe the problem or limitation you are having in your project
Godot's audio setup on Android currently uses [OpenSL ES](https://developer.android.com/ndk/guides/audio/opensl), an older audio API supported on Android API 9 and above. This API has high device coverage, but is bulkier and less suitable for low-latency applications compared to the native [AAudio](https://developer.android.com/ndk/guides/audio/aaudio/aaudio) API introduced in Android API 26.
### Describe the feature / enhancement and how it helps to overcome the problem or limitation
[Oboe](https://github.com/google/oboe) is Android's recommended modern audio API, acting as a C++ wrapper library that chooses between OpenSL ES and AAudio depending on device support and best performance. Oboe is compatible with API 16 onwards (covers 99% of Android devices). We expect this to modernize Godot's audio setup on Android, with lower audio latency and minimal loss of device coverage.
### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
We will create a class `AudioDriverOboe` housed under `godot/platform/android`, which will take the place of `AudioDriveOpenSL` in `OS_Android`. Much of its functionality will mirror `AudioDriverOpenSL`, informed by Oboe's [migration guide](https://github.com/google/oboe/blob/master/docs/OpenSLESMigration.md).
Steps:
1. Add Oboe to `godot/thirdparty` and link with SCons build system.
2. Implement `AudioDriverOboe` with the set of methods inherited from `AudioDriver`, and modify `os_android.h` to use it. More implementation details are available if requested.
3. Develop test apps for latency measurement and potentially device coverage.
`AudioDriverOboe` Member variables:
```
Mutex *mutex
static AudioDriverOboe *s_ad (singleton)
AudioStream player
AudioStream recorder
bool active
bool pause
```
`AudioDriverOboe` Implemented API:
```
const char *get_name()
Error init()
void start()
int get_mix_rate()
SpeakerMode get_speaker_mode()
void lock()
void unlock()
void finish()
void set_pause(bool p_pause)
Error capture_start()
Error capture_stop()
Constructor AudioDriverOboe()
```
For latency testing, the simplest version is the [Larsen test](https://source.android.com/devices/audio/latency/measure#larsenTest) with two AudioStreamPlayer nodes, one that records audio input and one that plays the input continuously. By measuring the time between sounds, we capture the sum of input and output latency, with some device/engine overhead. This should serve as an adequate measure for approximate latency improvement.
For testing device coverage, we should have a test app that covers audio features on Godot. This may be using the [mic_record](https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record) demo or some variation upon it which will use both input and output. If run on some device farm or set of devices, we may use app crashes or bad sound behavior to verify minimal loss in coverage.
### If this enhancement will not be used often, can it be worked around with a few lines of script?
N/A. This is expected to be used for all Godot games exported for Android.
### Is there a reason why this should be core and not an add-on in the asset library?
This proposal changes the audio (a core element of the engine) intending to impact all games for the Android platform.
Android Games DevTech Team @ Google
In the documentation of this setting, it says this:
Note: This setting is ignored on Android.
You can try fiddling with AudioServer::get_output_latency() to adjust your actions to match the audio latency:
Here someone mentioned that changing the file format to OGG fixed the problem for them.
Another person mentioned that changing volume is instantanous, so if that makes sense in your case then you can try doing the same.
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
sander48k
I am creating a 3D game with Godot 3.5.2 for mobile devices, both iOS and Android. Today I noticed that on some Android devices there is significant delay between a UI action, e.g. a button press, and the playback of a sound. I am using AudioStreamPlayer. The playback is started from GDScript when some action occurs.
To isolate the issue …
2 Likes