Skip to content

Add support for a SoundGenerator that plays multiple tracks at once #178

@jessegreenberg

Description

@jessegreenberg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions