Change summary
src/main/java/eu/siacs/conversations/ui/RecordingActivity.java | 9 ++-
1 file changed, 6 insertions(+), 3 deletions(-)
Detailed changes
@@ -106,6 +106,9 @@ public class RecordingActivity extends BaseActivity implements View.OnClickListe
private boolean startRecording() {
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
+ mRecorder.setPrivacySensitive(true);
+ }
final int outputFormat;
if (Config.USE_OPUS_VOICE_MESSAGES && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
outputFormat = MediaRecorder.OutputFormat.OGG;
@@ -115,14 +118,14 @@ public class RecordingActivity extends BaseActivity implements View.OnClickListe
} else {
outputFormat = MediaRecorder.OutputFormat.MPEG_4;
mRecorder.setOutputFormat(outputFormat);
- if (AAC_SENSITIVE_DEVICES.contains(Build.MODEL)) {
- // Changing these three settings for AAC sensitive devices might lead to sporadically truncated (cut-off) voice messages.
+ if (AAC_SENSITIVE_DEVICES.contains(Build.MODEL) && Build.VERSION.SDK_INT <= Build.VERSION_CODES.TIRAMISU) {
+ // Changing these three settings for AAC sensitive devices for Android<=13 might lead to sporadically truncated (cut-off) voice messages.
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.HE_AAC);
mRecorder.setAudioSamplingRate(24_000);
mRecorder.setAudioEncodingBitRate(28_000);
} else {
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
- mRecorder.setAudioSamplingRate(22_050);
+ mRecorder.setAudioSamplingRate(44_100);
mRecorder.setAudioEncodingBitRate(64_000);
}
}