You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Request Android record permission when needed
This commit is contained in:
committed by
Marcelo Fernandez
parent
a38bf5287a
commit
b22cf46fdb
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user