Skip to content

C2LC-254: Avoid playing sounds before they are loaded. #95

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

Merged
merged 3 commits into from
Nov 6, 2020

Conversation

the-t-in-rtf
Copy link
Contributor

See C2LC-254 for details.

@simonbates
Copy link
Contributor

Thanks Tony. A couple of comments:

  • I'm able to reproduce a similar error when triggering playAnnouncement(), so I think we need a check there also; it looks like Player also has a loaded property
    • To reproduce, click one of the commands in the command palette, such as a forward command
  • You added the loaded check to playSoundForCharacterState(), which calls playPitchedSample(); I suggest either moving the check to playPitchedSample() or marking playPitchedSample() as internal so that we don't call it directly in the future and get the error again

@the-t-in-rtf
Copy link
Contributor Author

I moved the check for the sampler closer to the usage of triggerAttackRelease. I also added a check for the announcements.

@simonbates simonbates merged commit 43b88c5 into codelearncreate:develop-0.5 Nov 6, 2020
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.

2 participants