Using Oboe with Kotlin #1418
-
How do I get the Oboe library to be loaded by Kotlin in Android Studio? val audioTrack = oboe.AudioStream( etc… I’m probably being a bit dumb but any help would be useful. I have attached the CMakeLists.txt file I can see the Gradle builder loading in the oboe 1.6.1 in android studio but i can’t access the oboe Audio Stream via Kotlin |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Have a look at the DrumThumper demo. It's UI is written in Kotlin. |
Beta Was this translation helpful? Give feedback.
-
DrumThumper is in the "samples" subproject in the Oboe repository.
https://github.com/google/oboe/tree/main/samples/drumthumper
- Paul
…On Tue, Oct 19, 2021 at 2:00 AM Ateros4me ***@***.***> wrote:
Thanks for the reply, have you a link to drmthumper as i can’t seem to
find it?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1418 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD24N6JDQL6ALLKY6X6UP2LUHUQQNANCNFSM5GDZ5OAA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Paul McLean
Software Engineer
Android Audio Engineering
303 579 0404
|
Beta Was this translation helpful? Give feedback.
-
The whole point of Oboe is to provide a high-performance C++ audio API, particularly getting all of the audio processing the C/C++ layer. Wrapping in it a Java/Kotlin layer would eliminate this benefit (i.e. it would become a Java/Kotlin API). If the Java AudioTrack API is sufficient for your purposes then you should use that. Since I perceive you want high performance (for real-time audio processing), you want to be working in the C/C++ layer. The recommended way to use Oboe in an application is to write just the UI layer in Java/Kotlin and have all of the audio processing in C/C++. It is certainly the case that you need to know how to write JNI (Java Native Interface) code, but that is sort-of the price of entry. I'm not as familiar with the FXLab sample, but DrumThumper does show how to use Oboe from a Kotlin app and handle all of the audio processing in the high-performance C/C++ layer. I hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Hi Don, i’ve tried using the DuplexEngine from the fxlab in the oboe clone checkout, but i keep getting the following error I can find the variant file under Android/Sdk/ndk/21.4.7075529/sources/cxx-stl/llvm-libc++/include but this didn’t fix the problem Chris |
Beta Was this translation helpful? Give feedback.
The whole point of Oboe is to provide a high-performance C++ audio API, particularly getting all of the audio processing the C/C++ layer. Wrapping in it a Java/Kotlin layer would eliminate this benefit (i.e. it would become a Java/Kotlin API).
If the Java AudioTrack API is sufficient for your purposes then you should use that. Since I perceive you want high performance (for real-time audio processing), you want to be working in the C/C++ layer.
The recommended way to use Oboe in an application is to write just the UI layer in Java/Kotlin and have all of the audio processing in C/C++. It is certainly the case that you need to know how to write JNI (Java Native Interface) code, but that is …