google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.72k stars 573 forks source link

write buffer directly from java #299

Closed yadidl closed 5 years ago

yadidl commented 5 years ago

Hey, There is a way to write audio buffer to oboe (that will use openSLES or AAudio) ? The plan is to replace the Audio track to get better latency. Currently the buffer build on the java side, so the question is if there is a way to replace the java Audio track with oboe somehow and write the buffer that built on the java side directly to the Audio engine ?

btw, I saw this code on the repo, and i am seeing that it using java AudioTrack. What I am trying to do is like on this file (SimpleAudioOutput.java") but i want to use oboe for better latency.

https://github.com/google/oboe/blob/master/apps/OboeTester/app/src/main/java/com/mobileer/miditools/synth/SimpleAudioOutput.java

Thanks, Yadid.

philburk commented 5 years ago

Other people have asked the same thing so I created a FAQ. https://github.com/google/oboe/blob/master/docs/FAQ.md

Also note that the MIDI code in OboeTester is a copy of the android-midisuite, which is more up-to-date. I will be removing some of the duplicate code in OboeTester. Use this instead:

https://github.com/philburk/android-midisuite/blob/master/MidiTools/src/main/java/com/mobileer/miditools/synth/SimpleAudioOutput.java