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

Adding Sound will stop the SoundChannel through the buffer during the close method execution. #2706

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

rainyt
Copy link
Contributor

@rainyt rainyt commented May 11, 2024

Fixed the issue where SoundChannel may cause SoundMixer to close during playback the __soundChannels array will not be removed, ultimately causing the audio to reach its maximum limit and unable to play the audio.

Like this:

var sound:Sound = openfl.Assets.getSound("assets/sound.mp3");
sound.play();
sound.close();
// The audio length is 1, but the correct value should be 0. 
// After the audio is turned off, you will never receive an audio playback completion event.
trace(@privateAccess SoundMixer.__soundChannels.length);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant