Android call recording using ALSA / CAF

I am writing a small call recording library for my root phone.
In some applications, I saw that recording is done through ALSA or CAF on root phones.
I could not find a single example / tutorial on how to use ALSA or CAF to record calls (or even to record sound, for that matter).
I saw the tinyAlsa lib project, but I could not figure out how to use it in an Android application. Can someone please show me some tutorial or sample code on how to integrate ALSA or CAF into an Android app?

Update I managed to wrap tinyAlsa with JNI calls. However, calls like mixer_open (0) return null pointers, and calls like pcm_open (...) return a pointer, but a subsequent call to is_pcm_ready (pcm) always returns false.
Am I doing something wrong? Did I miss something?

+5
source share
1 answer
  • Here's how to build ALSA lib using the Android toolkit.
  • and here you can find another repo that mentions ALSA for Android.

I suggest you read this post to understand what your options are and the current situation on the platform.

EDIT after comments:

I think you need to implement your solution using tinyalsa , assuming you are using the basic ALSA implementation. If something is missing in the tiny version, you may need to ask the author (but that sounds strange to me because you are doing basic operations). After reading this post , we can get some tips on why root is needed (access to secure mount points).

Keep us informed of your progress, this is an interesting topic!

0
source

Source: https://habr.com/ru/post/1211506/


All Articles