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 support for a SoundGenerator that plays multiple tracks at once #178

Open
jessegreenberg opened this issue Mar 21, 2023 · 0 comments
Open

Comments

@jessegreenberg
Copy link
Contributor

In quadrilateral, there is a SoundGenerator that plays multiple tracks at once. All tracks play continuously in the background all the time, even at 0 volume. The tracks fade in and out by setting the output level of the parent SoundGenerator in the step function. Playing them continuously without stop supports keeping all tracks in sync as they fade in and fade out.

https://github.com/phetsims/quadrilateral/blob/2a39132708004c41ddeb99bf53409e06a24389dc/js/quadrilateral/view/sound/TracksSoundView.ts

During code review, it was suggested that this could be a useful reusable common code component. After discussing with @jbphet we decided to create an issue in tambo to document this. We will consider adding common code support the next time this sound design is used.

@jbphet also mentioned that playing many SoundClips all the time at 0 volume could be taking up too many resources unnecessarily. It might be better to use start and stop instead, starting tracks at different offset times so they still play in sync.

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

No branches or pull requests

1 participant