Sound effects on notifications

This commit is contained in:
2026-01-11 23:32:00 +08:00
parent 00e063e99f
commit 63a55658ab
6 changed files with 45 additions and 33 deletions

View File

@@ -107,13 +107,10 @@ StreamSubscription<WebSocketPacket> setupNotificationListener(
}
if (settings.soundEffects) {
final player = AudioPlayer();
player
.setAudioSource(
AudioSource.asset('assets/audio/notification.mp3'),
)
.then((_) {
player.play().then((_) => player.dispose());
});
await player.setVolume(0.75);
await player.setAudioSource(AudioSource.asset('assets/audio/notification.mp3'));
await player.play();
player.dispose();
}
showTopSnackBar(
globalOverlay.currentState!,
@@ -231,4 +228,4 @@ Future<void> _putTokenToRemote(
"/ring/notifications/subscription",
data: {"provider": provider, "device_token": token},
);
}
}