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

Clear buffers before preloading first section #1009

Merged
merged 1 commit into from
May 14, 2024

Conversation

Evert-R
Copy link
Contributor

@Evert-R Evert-R commented May 8, 2024

This PR fixes #1006

The webAudio.clearBuffers() function was moved in #1003 to act as the cleanup function for the react hook it's in.
When preloading a section that was also used in the previous turn, the preloading of the section was skipped by webAudio.checkSectionLoaded() after which the buffers were cleared on cleanup and there was nothing to play, which caused the experiment to freeze.
Putting the webAudio.clearBuffers() back in place solved the problem.

As most experiments only use 1 section per round the webAudio.clearBuffers() was meant to prevent the loaded buffers from taking up to much memory: Otherwise if there were 30 rounds with unique sections, all 30 buffers would remain in memory untill the experiment was finished, which could cause problems.

I made some further suggestions to improve performance in issue #1008

@Evert-R Evert-R requested a review from BeritJanssen May 8, 2024 12:29
@Evert-R Evert-R merged commit dc9641d into develop May 14, 2024
11 checks passed
@Evert-R Evert-R deleted the bugfix-er/categorization-audio branch May 14, 2024 08:14
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.

🐛 [BUG] - Categorization audio not working on develop
1 participant