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

AudioSource does not check event emitter #16986

Open
smallmain opened this issue May 13, 2024 · 0 comments
Open

AudioSource does not check event emitter #16986

smallmain opened this issue May 13, 2024 · 0 comments
Assignees
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@smallmain
Copy link

Cocos Creator version

3.8.2

System information

MacOS

Issue description

audio-source.ts

...
this.node?.emit(_LOADED_EVENT);
...
this.node?.once(_LOADED_EVENT, () => {
    resolve(this._player?.getPCMData(channelIndex));
});
...
this.node?.once(_LOADED_EVENT, () => {
    resolve(this._player!.sampleRate);
});

If multiple audio-source components are hung on a node, problems may occur.
Because this.node?.once may be listening to events emitted by other components.

Relevant error log output

No response

Steps to reproduce

.

Minimal reproduction project

No response

@smallmain smallmain added Bug Needs Triage Needs to be assigned by the team labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

2 participants