Skip to content

Commit 0e27d3c

Browse files
committed
Revert "Migrate from "oboe" to "ndk::audio" (RustAudio#961)"
This reverts commit c5a163e.
1 parent c03e899 commit 0e27d3c

File tree

19 files changed

+424
-752
lines changed

19 files changed

+424
-752
lines changed

.github/workflows/cpal.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Run clippy
2525
run: cargo clippy --all --all-features
2626
- name: Run clippy for Android target
27-
run: cargo clippy --all --features asio --target armv7-linux-androideabi
27+
run: cargo clippy --all --features asio --features oboe/fetch-prebuilt --target armv7-linux-androideabi
2828

2929
rustfmt-check:
3030
runs-on: ubuntu-latest
@@ -207,16 +207,15 @@ jobs:
207207
with:
208208
target: armv7-linux-androideabi
209209
- name: Check android
210-
working-directory: examples/android
211-
run: cargo check --target armv7-linux-androideabi --verbose
210+
run: cargo check --example android --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
212211
- name: Check beep
213-
run: cargo check --example beep --target armv7-linux-androideabi --verbose
212+
run: cargo check --example beep --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
214213
- name: Check enumerate
215-
run: cargo check --example enumerate --target armv7-linux-androideabi --verbose
214+
run: cargo check --example enumerate --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
216215
- name: Check feedback
217-
run: cargo check --example feedback --target armv7-linux-androideabi --verbose
216+
run: cargo check --example feedback --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
218217
- name: Check record_wav
219-
run: cargo check --example record_wav --target armv7-linux-androideabi --verbose
218+
run: cargo check --example record_wav --target armv7-linux-androideabi --features oboe/fetch-prebuilt --verbose
220219

221220
android-apk-build:
222221
runs-on: ubuntu-latest
@@ -228,12 +227,11 @@ jobs:
228227
targets: armv7-linux-androideabi,aarch64-linux-android,i686-linux-android,x86_64-linux-android
229228
- name: Set Up Android tools
230229
run: |
231-
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "build-tools;30.0.2" "platforms;android-30"
230+
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-30"
232231
- name: Install Cargo APK
233232
run: cargo install cargo-apk
234233
- name: Build APK
235-
working-directory: examples/android
236-
run: cargo apk build
234+
run: cargo apk build --example android
237235

238236
ios-build:
239237
runs-on: macOS-latest

Cargo.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rust-version = "1.70"
1111

1212
[features]
1313
asio = ["asio-sys", "num-traits"] # Only available on Windows. See README for setup instructions.
14+
oboe-shared-stdcxx = ["oboe/shared-stdcxx"] # Only available on Android. See README for what it does.
1415

1516
# Deprecated, the `oboe` backend has been removed
1617
oboe-shared-stdcxx = []
@@ -24,6 +25,9 @@ hound = "3.5"
2425
ringbuf = "0.4.1"
2526
clap = { version = "4.0", features = ["derive"] }
2627

28+
[target.'cfg(target_os = "android")'.dev-dependencies]
29+
ndk-glue = "0.7"
30+
2731
[target.'cfg(target_os = "windows")'.dependencies]
2832
windows = { version = "0.54.0", features = [
2933
"Win32_Media_Audio",
@@ -83,11 +87,15 @@ js-sys = { version = "0.3.35" }
8387
web-sys = { version = "0.3.35", features = [ "AudioContext", "AudioContextOptions", "AudioBuffer", "AudioBufferSourceNode", "AudioNode", "AudioDestinationNode", "Window", "AudioContextState"] }
8488

8589
[target.'cfg(target_os = "android")'.dependencies]
86-
ndk = { version = "0.9", default-features = false, features = ["audio", "api-level-26"]}
90+
oboe = { version = "0.6", features = [ "java-interface" ] }
91+
ndk = { version = "0.8", default-features = false }
8792
ndk-context = "0.1"
8893
jni = "0.21"
89-
num-derive = "0.4"
90-
num-traits = "0.2"
94+
95+
[[example]]
96+
name = "android"
97+
path = "examples/android.rs"
98+
crate-type = ["cdylib"]
9199

92100
[[example]]
93101
name = "beep"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Currently, supported hosts include:
2020
- Windows (via WASAPI by default, see ASIO instructions below)
2121
- macOS (via CoreAudio)
2222
- iOS (via CoreAudio)
23-
- Android (via AAudio)
23+
- Android (via Oboe)
2424
- Emscripten
2525

2626
Note that on Linux, the ALSA development files are required. These are provided
@@ -38,6 +38,10 @@ Some audio backends are optional and will only be compiled with a [feature flag]
3838
- JACK (on Linux): `jack`
3939
- ASIO (on Windows): `asio`
4040

41+
Oboe can either use a shared or static runtime. The static runtime is used by default, but activating the
42+
`oboe-shared-stdcxx` feature makes it use the shared runtime, which requires `libc++_shared.so` from the Android NDK to
43+
be present during execution.
44+
4145
## ASIO on Windows
4246

4347
[ASIO](https://en.wikipedia.org/wiki/Audio_Stream_Input/Output) is an audio
File renamed without changes.

examples/android/.gitignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/android/Cargo.toml

Lines changed: 0 additions & 30 deletions
This file was deleted.

examples/android/README.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/host/aaudio/java_interface.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/host/aaudio/java_interface/audio_features.rs

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/host/aaudio/java_interface/definitions.rs

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)