Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What do I need to clean up after using Assets Audio Player? #812

Open
davoutuk opened this issue Oct 28, 2023 · 0 comments
Open

What do I need to clean up after using Assets Audio Player? #812

davoutuk opened this issue Oct 28, 2023 · 0 comments
Assignees
Labels
new feature New feature or request

Comments

@davoutuk
Copy link

davoutuk commented Oct 28, 2023

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?  

@davoutuk davoutuk added the new feature New feature or request label Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants