Monday, 16 August 2021

Android: Access AudioRecord.Builder class from JNI level similar to AudioRecord

What is right way to access AudioRecord.Builder from JNI level https://developer.android.com/reference/android/media/AudioRecord.Builder

similar to AudioRecord class.

(jclass)jni_env->NewGlobalRef(jni_env->FindClass("android/media/AudioRecord"));

ex:

AudioRecord recorder = new AudioRecord.Builder()
         .setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
         .setAudioFormat(new AudioFormat.Builder()
                 .setEncoding(AudioFormat.ENCODING_PCM_16BIT)
                 .setSampleRate(32000)
                 .setChannelMask(AudioFormat.CHANNEL_IN_MONO)
                 .build())
         .setBufferSizeInBytes(2*minBuffSize)
         .build();

Thanks



from Android: Access AudioRecord.Builder class from JNI level similar to AudioRecord

No comments:

Post a Comment