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

Add method to clear all audioSource inside AudioPlayer #1415

Open
bianca8 opened this issue Feb 28, 2025 · 5 comments
Open

Add method to clear all audioSource inside AudioPlayer #1415

bianca8 opened this issue Feb 28, 2025 · 5 comments
Assignees
Labels
1 backlog enhancement New feature or request

Comments

@bianca8
Copy link

bianca8 commented Feb 28, 2025

Is your feature request related to a problem? Please describe.
I don't see any clear() method to clear all audioSources in the AudioPlayer!
Even in the documentation it is not clear how to delete everything, so I think is necessary to add a method to remove all audioSource.

Describe the solution you'd like
Add a method to clear all

Describe alternatives you've considered
There isn't an alternative

Additional context
Nobody

@bianca8 bianca8 added 1 backlog enhancement New feature or request labels Feb 28, 2025
@ryanheise
Copy link
Owner

The next major release will offer a playlist API on the player instance itself, including a clear method. Until then, if you set a ConcatenatingAudioSource as the main audio source of the player, you can just call the clear method on that to achieve the same effect. (The new playlist will be implemented internally by just doing that.)

@bianca8
Copy link
Author

bianca8 commented Mar 1, 2025

Hi @ryanheise
Thank you for your answer! I have two more questions.

  1. After calling the clear on ConcatenatingAudioSource, do I have to call the setAudioSource again?

  2. So, it’s possible to delete the elements of a playlist, but not on the single audio? Because if instead I load the single audio, I noticed that before loading the new audio, it makes me hear the previous audio for a few seconds, I wonder if it's a bug or if it's possible to solve this problem in some way.

I hope I was clear.

@ryanheise
Copy link
Owner

@bianca8 , please consult the examples in this repo if you would like to see how to use ConcatenatingAudioSource. I would like to keep this issue focused on the given feature request, so if you would like to report a bug, please open a new issue for that. If you have questions, the place reserved for that is StackOverflow.

@bianca8
Copy link
Author

bianca8 commented Mar 1, 2025

Ok clear, thanks @ryanheise
When do you plan to release this major release?

@ryanheise
Copy link
Owner

As soon as I get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 backlog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants