1
0
Fork 1

Merge pull request 'Do not play a connection sound when establishing an audio-/videocall. Reduce volume of call integration sounds.' (#244) from p42ity/monocles_chat:call_effects into master

Reviewed-on: https://codeberg.org/monocles/monocles_chat/pulls/244
This commit is contained in:
Arne-Brün Vogelsang 2024-12-22 09:22:08 +00:00
commit dd821d6238
2 changed files with 2 additions and 21 deletions

View file

@ -59,8 +59,7 @@ public class CallIntegration extends Connection {
private static final List<String> BROKEN_MANUFACTURES_UP_TO_11 =
Arrays.asList("realme", "oppo", "oneplus");
public static final int DEFAULT_TONE_VOLUME = 60;
private static final int DEFAULT_MEDIA_PLAYER_VOLUME = 90;
public static final int DEFAULT_TONE_VOLUME = 20;
private final Context context;
@ -379,9 +378,7 @@ public class CallIntegration extends Connection {
requireAppRtcAudioManager().stopRingBack();
}
}
if (state == STATE_ACTIVE) {
playConnectedSound();
} else if (state == STATE_DISCONNECTED) {
if (state == STATE_DISCONNECTED) {
final var audioManager = this.appRTCAudioManager;
if (audioManager != null) {
audioManager.executeOnMain(audioManager::stop);
@ -389,22 +386,6 @@ public class CallIntegration extends Connection {
}
}
private void playConnectedSound() {
final var audioAttributes =
new AudioAttributes.Builder()
.setLegacyStreamType(AudioManager.STREAM_VOICE_CALL)
.build();
final var mediaPlayer =
MediaPlayer.create(
context,
R.raw.connected,
audioAttributes,
AudioManager.AUDIO_SESSION_ID_GENERATE);
mediaPlayer.setVolume(
DEFAULT_MEDIA_PLAYER_VOLUME / 100f, DEFAULT_MEDIA_PLAYER_VOLUME / 100f);
mediaPlayer.start();
}
public void success() {
Log.d(Config.LOGTAG, "CallIntegration.success()");
startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CALLDROP_LITE, 375);

Binary file not shown.