From 870dcf916eca51a8436e4331b1fd7517a393c900 Mon Sep 17 00:00:00 2001 From: MjKey Date: Wed, 11 Sep 2024 14:46:57 +0300 Subject: [PATCH] Add Sounds --- lib/main.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 537c7b4..b123ebb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -235,7 +235,7 @@ class _MainScreenState extends State { String _socketUrl = 'https://socket5.donationalerts.ru'; SocketService? _socketService; String _localIpAddress = ''; - final AudioPlayer = AudioPlayer(); + final AudioPlayer _audioPlayer = AudioPlayer(); int _httpPort = 8080; int _wsPort = 4040; List _processedDonations = []; @@ -273,7 +273,7 @@ class _MainScreenState extends State { void _incrementCounter() { setState(() { - .play(AssetSource('pepe.mp3')); + _audioPlayer.play(AssetSource('pepe.mp3')); _showAuthorInfo(); }); } @@ -1574,7 +1574,7 @@ class _MainScreenState extends State { final file = _isRandomSoundEnabled ? (_soundFiles..shuffle()).first : _soundFiles.first; - .play(file.path, isLocal: true); + _audioPlayer.play(file.path as Source); LogManager.log(Level.INFO, 'Воспроизведение звука: ${file.path}'); } }