1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-06 17:25:19 +00:00

Implement Audio Input support on Android

This commit is contained in:
Marcelo Fernandez
2019-02-26 08:35:09 -03:00
parent ce615c1a82
commit 29fb6b4e15
2 changed files with 119 additions and 0 deletions

View File

@@ -54,13 +54,18 @@ class AudioDriverOpenSL : public AudioDriver {
int32_t *mixdown_buffer;
int last_free;
Vector<int16_t> rec_buffer;
SLPlayItf playItf;
SLRecordItf recordItf;
SLObjectItf sl;
SLEngineItf EngineItf;
SLObjectItf OutputMix;
SLVolumeItf volumeItf;
SLObjectItf player;
SLObjectItf recorder;
SLAndroidSimpleBufferQueueItf bufferQueueItf;
SLAndroidSimpleBufferQueueItf recordBufferQueueItf;
SLDataSource audioSource;
SLDataFormat_PCM pcm;
SLDataSink audioSink;
@@ -76,6 +81,13 @@ class AudioDriverOpenSL : public AudioDriver {
SLAndroidSimpleBufferQueueItf queueItf,
void *pContext);
void _record_buffer_callback(
SLAndroidSimpleBufferQueueItf queueItf);
static void _record_buffer_callbacks(
SLAndroidSimpleBufferQueueItf queueItf,
void *pContext);
public:
void set_singleton();
@@ -91,6 +103,9 @@ public:
virtual void set_pause(bool p_pause);
virtual Error capture_start();
virtual Error capture_stop();
AudioDriverOpenSL();
};