summaryrefslogtreecommitdiff
path: root/platform/android/audio_driver_opensl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/audio_driver_opensl.cpp')
-rw-r--r--platform/android/audio_driver_opensl.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp
index 0d62b242a8..8913950fac 100644
--- a/platform/android/audio_driver_opensl.cpp
+++ b/platform/android/audio_driver_opensl.cpp
@@ -230,7 +230,7 @@ void AudioDriverOpenSL::_record_buffer_callbacks(SLAndroidSimpleBufferQueueItf q
ad->_record_buffer_callback(queueItf);
}
-Error AudioDriverOpenSL::capture_start() {
+Error AudioDriverOpenSL::capture_init_device() {
SLDataLocator_IODevice loc_dev = {
SL_DATALOCATOR_IODEVICE,
@@ -298,6 +298,15 @@ Error AudioDriverOpenSL::capture_start() {
return OK;
}
+Error AudioDriverOpenSL::capture_start() {
+
+ if (OS::get_singleton()->request_permission("RECORD_AUDIO")) {
+ return capture_init_device();
+ }
+
+ return OK;
+}
+
Error AudioDriverOpenSL::capture_stop() {
SLuint32 state;