From 7b5e8e56c20c2ffaa8689daecce3f984e16587eb Mon Sep 17 00:00:00 2001 From: Littlegnal <8847263+littleGnAl@users.noreply.github.com> Date: Tue, 26 Oct 2021 14:09:07 +0800 Subject: [PATCH] feat: [Android] Implement custom audio source example (#475) --- example/android/app/build.gradle | 9 + .../android/app/src/main/AndroidManifest.xml | 5 + .../agora_rtc_engine_example/MainActivity.kt | 25 ++ .../AudioRecordService.java | 195 +++++++++++++ .../custom_audio_source/AudioStatus.java | 7 + .../custom_audio_source/CustomAudioPlugin.kt | 73 +++++ .../CustomAudioSource.java | 156 +++++++++++ example/ios/Runner/CustomAudioSource.h | 24 ++ example/ios/Runner/CustomAudioSource.m | 141 ++++++++++ .../custom_audio/custom_audio_source.dart | 260 ++++++++++++++++++ .../custom_audio/custom_audio_source_api.dart | 18 ++ .../custom_audio_source_api.generated.dart | 116 ++++++++ example/lib/examples/advanced/index.dart | 2 + example/pubspec.yaml | 1 + 14 files changed, 1032 insertions(+) create mode 100644 example/android/app/src/main/kotlin/io/agora/agora_rtc_engine_example/custom_audio_source/AudioRecordService.java create mode 100644 example/android/app/src/main/kotlin/io/agora/agora_rtc_engine_example/custom_audio_source/AudioStatus.java create mode 100644 example/android/app/src/main/kotlin/io/agora/agora_rtc_engine_example/custom_audio_source/CustomAudioPlugin.kt create mode 100644 example/android/app/src/main/kotlin/io/agora/agora_rtc_engine_example/custom_audio_source/CustomAudioSource.java create mode 100644 example/ios/Runner/CustomAudioSource.h create mode 100644 example/ios/Runner/CustomAudioSource.m create mode 100644 example/lib/examples/advanced/custom_audio/custom_audio_source.dart create mode 100644 example/lib/examples/advanced/custom_audio/custom_audio_source_api.dart create mode 100644 example/lib/examples/advanced/custom_audio/custom_audio_source_api.generated.dart diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index bed57d628..6dea3dfea 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -28,6 +28,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 28 + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' test.java.srcDirs += 'src/test/kotlin' diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index e9215f26c..107b7e977 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,7 @@ +