Skip to content

Commit 2d7dabf

Browse files
committed
DEBUG: turn off any gain processing on microphone for debug version
1 parent e75fc35 commit 2d7dabf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

android-refimpl-app/app/src/main/java/com/zoffcc/applications/nativeaudio/NativeAudio.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ public static void rec_buffer_ready(int rec_buffer_num)
206206

207207
public static native void set_aec_active(int active);
208208

209+
public static native void set_gainprocessing_active(int active);
210+
209211
public static native void set_rec_preset(boolean with_loud_speaker);
210212

211213
public static native int get_aec_active();

android-refimpl-app/native-audio-jni/src/main/cpp/native-audio-jni.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,13 @@ void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void *context)
541541

542542

543543

544+
int16_t *this_buffer_pcm16 = (int16_t *) audio_rec_buffer[rec_buf_pointer_start];
545+
int this_buffer_size_pcm16 = audio_rec_buffer_size[rec_buf_pointer_start] / 2;
544546

545547

546548
if (gainprocessing_active == 1)
547549
{
548550

549-
int16_t *this_buffer_pcm16 = (int16_t *) audio_rec_buffer[rec_buf_pointer_start];
550-
int this_buffer_size_pcm16 = audio_rec_buffer_size[rec_buf_pointer_start] / 2;
551-
552551
#if 1
553552
// TODO: make this better? faster?
554553
// --------------------------------------------------

0 commit comments

Comments
 (0)