This is an issue related to Android AudioRecord and Exoplayer.
The required scene is to record while playing the accompaniment (note: the sound of the accompaniment file is fluctuatingly large and small);
The problem found so far: When the earphone is inserted into the recording and playback, the recorded sound is normal, but the sound played through the speaker gradually becomes flat (no longer loud and small)
And I tried these parameters, but nothing works:
val canceler = AcousticEchoCanceler.create(record.audioSessionId)
val suppressor = NoiseSuppressor.create(record.audioSessionId)
if (suppressor != null) {
suppressor.enabled = false
}
if (canceler != null) {
canceler.enabled = false
}
if (AutomaticGainControl.isAvailable()) {
val gainControl = AutomaticGainControl.create(record.audioSessionId)
gainControl.enabled = false
}