Changing Talk Voice Playback in Android Custom ROM

I would like to change the Android OS (the official image from AOSP) to add preprocessing to the normal sound of playing phone calls.

I have already achieved this filtering for playing audio in an application (by changing the HAL and audio fragmenter).

I'm fine targeting only a specific device (Nexus 5X). In addition, I only need to filter the playback - I do not care about the recording (uplink).

UPDATE: To make it clear - I'm fine with the modification of certain Qualcomm drivers, or any part that works on the Nexus 5X can help me change the playback in call mode.

UPDATE # 2:

I am trying to create a Java-level application that directs phone playback to a music stream in real time. I already managed to install it as a system application, having received permissions to initialize AudioRecord using AudioSource.VOICE_DOWNLINK . However, the record gives empty samples; it does not record a voice call.

Code inside my workflow:

 // Start recording int recBufferSize = AudioRecord.getMinBufferSize(44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT); mRecord = new AudioRecord(MediaRecorder.AudioSource.VOICE_DOWNLINK, 44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, recBufferSize); // Start playback int playBufferSize = AudioTrack.getMinBufferSize(44100, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT); mTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 44100, AudioFormat.CHANNEL_OUT_STEREO, AudioFormat.ENCODING_PCM_16BIT, playBufferSize, AudioTrack.MODE_STREAM); mRecord.startRecording();; mTrack.play(); int bufSize = 1024; short[] buffer = new short[bufSize]; int res; while (!interrupted()) { // Pull recording buffers and play back res = mRecord.read(buffer, 0, bufSize, AudioRecord.READ_NON_BLOCKING); mTrack.write(buffer, 0, res, AudioTrack.WRITE_BLOCKING); } // Stop recording mRecord.stop(); mRecord.release(); mRecord = null; // Stop playback mTrack.stop(); mTrack.release();; mTrack = null; 

I work on Nexus 5X, my own AOSP-ROM, Android 7.1.1. I need to find a place that will allow me to work with recording calls - perhaps somewhere in hardware/qcom/audio/hal in the platform code.

Also I looked: Function voice_check_and_set_incall_rec_usecase with hardware/qcom/audio/hal/voice.c But he couldn’t understand from this or how to make it work.

UPDATE # 3: I opened a more specific question about using AudioSource.VOICE_DOWNLINK , which may attract attention and ultimately help me resolve this issue. Call recording - make it work on Nexus 5X (possibly rooting or user disk)

+61
android android-source alsa android-kernel
Feb 15 '17 at 13:52
source share

No one has answered this question yet.

See similar questions:

24
Call recording - make it work with Nexus 5X (rooting or user ROM is possible)
13
Redirecting audio / creating alternative audio tracks in Android

or similar:

60
Android AudioRecord class - quickly launches a live microphone, sets up a callback function
29th
Real-time sound from a microphone
24
Call recording - make it work with Nexus 5X (rooting or user ROM is possible)
5
Implementing uplink audio when calling using Snapdragon MSM8960 SoC
four
Android - How to add my own audio codec to AudioRecord?
3
Routing a phone call to a custom sound service in Android?
2
is it possible to dynamically connect to libcsd-client.so to be included in voice recordings over the phone on the Galaxy S4 I9505
one
Android AudioRecord error when calling startRecording () method
one
Record \ Play sound directly using libmedia \ AudioFlinger
one
what does the error message "AFCCreateReSampler: avAFCInfo-> bUsed [0] in SampleRate [44100] outSampleRate [16000] ..." mean?



All Articles