-
Notifications
You must be signed in to change notification settings - Fork 121
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
Allows multiple instance of the same clip to be played simultaneously. #25
Conversation
This might fix some issues with some sounds not being played sometimes. Also might require more memory since more clips are created.
Could the extra clips be destroyed afterwards? Just from one play of this map, about 40 clips get created and my memory usage went up by ~80mb with the default skin. That's probably too much... |
Yea, but it becomes a question of when to destroy it. Maybe I should try the other idea of using TargetDataLine and see how that turns out. |
Yeah, I can't think of a good solution. The game hangs a lot when closing clips, so closing them immediately isn't an option. But it seems silly to allocate so much extra space for sound effects... How does this sound? We could set a reasonable global limit on the number of Clips created, and whenever that limit is reached, just reuse the last clip played from each MultiClip (e.g. cutting off the original). We could close all the extra clips before/after playing a beatmap (maybe in a separate thread?). |
reuse clips close extraclips in ranking
Maybe have a limit on each MultiClip instead, so that one MultiClip can't just steal all the extra clips? |
I think it's actually okay as-is, since extra space gets allocated to whatever clips need them most. I'll merge this now and make a couple of small changes (reducing number of methods, setting MAX_CLIP to 20, etc.). Thanks so much! |
Allows multiple instance of the same clip to be played simultaneously.
- Moved all MultiClip-handling methods into the MultiClip class. - Destroy extra clips when starting and finishing new beatmaps. - Reduced maximum number of extra clips to 20. - Attempted fixes at multithreading issues. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This might fix some issues with some sounds not being played sometimes.
Also might require more memory since more clips are created.