googlearchive / android-audio-high-performance

We now recommend you use the Oboe libraries:
https://github.com/google/oboe
Apache License 2.0
720 stars 275 forks source link

AAudio sample buffer size Optimization #40

Closed ggfan closed 7 years ago

ggfan commented 7 years ago

Optional:

Currently sample gets the buffer size and frequency from Java side; the only used one is actually frequency. The buffer size used to read/write AAudio's internal circular buffer is HARDCODED to framesPerBuffer(), which does not depend on Java side code ( but by all means it should be the same value though ).

Need re-visit this area and remove Java side parameter pulling to avoid confusion, of course, after a good cup of tea with @philburk

ggfan commented 7 years ago

some cleanup in the pull: https://github.com/googlesamples/android-audio-high-performance/pull/43

philburk commented 7 years ago

The native AAudio framesPerBurst is more accurate than the Java AudioManager query because it is device specific. Depending on the device, they may not be the same.

ggfan commented 7 years ago

buffer size is cleaned out: no coming from Java side etc