Skip to content

Commit a73f920

Browse files
committed
Add minimal Oboe audio library example
Based on the demo in the oboe-rs repo this is a minimal example that runs with GameActivity and plays a 440Hz sine wave
1 parent bb8eeb7 commit a73f920

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1175
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exclude = [
77
"examples/agdk-mainloop",
88
"examples/agdk-winit-wgpu",
99
"examples/agdk-egui",
10+
"examples/agdk-oboe",
1011
"examples/na-mainloop",
1112
"examples/na-winit-wgpu",
1213
"examples/na-subclass-jni"

examples/agdk-oboe/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
*.so
17+
18+
# Added by cargo
19+
20+
/target
21+
Cargo.lock

examples/agdk-oboe/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/agdk-oboe/.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/agdk-oboe/.idea/gradle.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/agdk-oboe/.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/agdk-oboe/.idea/vcs.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/agdk-oboe/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "agdk-oboe"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
log = "0.4"
10+
android_logger = "0.11.0"
11+
android-activity = { path="../../android-activity", features = ["game-activity"] }
12+
oboe = { version = "0.4", features = ["java-interface"] }
13+
atomic_float = "0.1"
14+
15+
[lib]
16+
name="main"
17+
crate_type=["cdylib"]

examples/agdk-oboe/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
This is a minimal test application based on `GameActivity` that just
2+
runs a mainloop based on android_activity::poll_events() and plays a
3+
sine wave audio test using the Oboe audio library.
4+
5+
```
6+
export ANDROID_NDK_HOME="path/to/ndk"
7+
export ANDROID_HOME="path/to/sdk"
8+
9+
rustup target add aarch64-linux-android
10+
cargo install cargo-ndk
11+
12+
cargo ndk -t arm64-v8a -o app/src/main/jniLibs/ build
13+
./gradlew build
14+
./gradlew installDebug
15+
adb shell am start -n co.realfit.agdkoboe/.MainActivity
16+
```

examples/agdk-oboe/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

0 commit comments

Comments
 (0)