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

Severe lag in playing multiple UIs at the same time #64

Closed
BytesZero opened this issue Apr 17, 2021 · 2 comments
Closed

Severe lag in playing multiple UIs at the same time #64

BytesZero opened this issue Apr 17, 2021 · 2 comments

Comments

@BytesZero
Copy link

Playing multiple audio at the same time will freeze the UI problem, as shown in the two videos below, I have solved this problem, see pr for details

  • Before repair
1618624768635431.mp4
  • After repair
1618625087219946.mp4
  • Code

image

@ukasz123
Copy link
Owner

@yy1300326388 Thank you for the solution. It may be good idea to perform all of audio operations on separate thread.

Have you tried to set maxStreams = 9 in the Soundpool constructor.

@BytesZero
Copy link
Author

BytesZero commented Apr 19, 2021

@ukasz123
The number of simultaneous playback of my scene is dynamic, it has nothing to do with maxStreams, and I set it during the first initialization.

I tried the settings but it does not work.

sound = Soundpool(maxStreams: 9);
loadAduio();

ukasz123 added a commit that referenced this issue May 30, 2021
Move all operation on Soundpool to separate thread pool
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 a pull request may close this issue.

2 participants