Skip to content

Commit

Permalink
Close audio player when done
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Aug 9, 2024
1 parent 2d9f385 commit 197801c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### V 1.0.9

- Fix custom sounds on android and IOS.
- Other Bug Fixes

### V 1.0.8

- Fix update available checks
Expand Down
6 changes: 5 additions & 1 deletion lib/Backend/audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ final Logger _audioLogger = Logger('Audio');

Future<void> playSound(String file) async {
final player = AudioPlayer();
await player.play(DeviceFileSource(file));
try {
await player.play(DeviceFileSource(file));
} finally {
player.dispose();
}
}

@Riverpod(keepAlive: true)
Expand Down

0 comments on commit 197801c

Please sign in to comment.