Flutter-AssetsAudioPlayer
Flutter-AssetsAudioPlayer copied to clipboard
What do I need to clean up after using Assets Audio Player?
It's not clear to me what I need to do when using Asssets Audio Player iin terms of freeing/releasing resources.
For example, I have the following standalone method in one of my classes...
Future<void> _playWarning() async {
final aPlayer = AssetsAudioPlayer();
try {
await aPlayer.open(Audio(PomodoroSoundAssets.getWarning()) );
await aPlayer.play();
} catch (t) {
//stream unreachable
}
}
.... should I include a 'finally' block that releases something?