# About AAudio support on android

**URL:** https://qa.fmod.com/t/about-aaudio-support-on-android/15033
**Category:** FMOD Engine
**Created:** [September 8, 2019, 10:32am UTC](https://qa.fmod.com/t/about-aaudio-support-on-android/15033 "2019-09-08T10:32:45Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![jiyongman](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jiyongman](https://qa.fmod.com/u/jiyongman)
#### Post date: [September 28, 2019, 3:30pm UTC](https://qa.fmod.com/t/about-aaudio-support-on-android/15033/6 "2019-09-28T15:30:41Z")

</div>

Wow! After reading your reply, now I can better understand how FMOD Studio works. Thank you very much.  
I think I’m almost there now.  
Still lots of questions below, but this time it’ll be easier for you to answer, I guess.  
Also, this is the last time. I promise.

**Q1**.  
In [this](https://www.fmod.com/resources/documentation-api?version=2.0&page=white-papers-cpu-performance.html#sample-rate) page, it says :

> “Be aware that this will only happen if there are no pitch / frequency settings applied to the Channel, so this trick is often good for music.”

Why are _pitch_ and _frequency_ specifically mentioned here?  
Is it because the two are the only processing which requires resampling under the hood, unlike other DSPs?

**Q2**.  
As you know, in order to achieve low-latency on Android, it’s also important to set **OpenSL ES** ’ buffer size properly using a value returned by _getProperty(AudioManager.PROPERTY\_OUTPUT\_FRAMES\_PER\_BUFFER)_.  
Now I know **fmod.jar** ’s _init()_ will adjust the sample rate automatically.  
But what about buffer size? Will _init()_ take care of it as well?

**Q3**.  
It’s somewhat obscure whether _FMOD\_System\_SetDSPBufferSize()_ sets FMOD System’s internal buffer or **OpenSL ES** ’ (or **AAudio** ’s).

I once wrote a Windows application with FMOD which used **ASIO**.  
At that time, it crashed when unsupported values by my audio interface were set.  
Also, one poster’s [question](https://qa.fmod.com/t/asio-how-do-i-programmatically-set-the-buffer-size-fmod-should-use-to-match-that-of-asio-driver/14079/4) here says only values supported by the audio interface worked.

But your [document](https://www.fmod.com/resources/documentation-api?version=2.0&page=core-api-system.html#system_setdspbuffersize) says

> “Sets the buffer size settings for the FMOD software mixing engine.”

So this is confusing.  
Is _FMOD\_System\_SetDSPBufferSize()_ for the FMOD System only?  
If yes, how can I set the **OpenSL ES** ’ (or **AAudio’s** ) buffer size?

Even aside from latency issue, setting proper buffersize is important because [this](https://stackoverflow.com/questions/14842803/low-latency-audio-playback-on-android) accepted answer from an Android audio team developer says there’s a bug on Android M :

> “Make your buffer size a multiple of AudioManager.getProperty(PROPERTY\_OUTPUT\_FRAMES\_PER\_BUFFER). Otherwise your callback will occasionally get two calls per timeslice rather than one.  
> … (On Android M, it is very important to use EXACTLY the system buffer size, due to a bug in the buffer handling code.)”

---

_[View the full topic](https://qa.fmod.com/t/about-aaudio-support-on-android/15033)._
