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 multiple clip playing support #544

Merged
merged 8 commits into from
Apr 2, 2024

Conversation

BenCheung0422
Copy link
Member

@BenCheung0422 BenCheung0422 commented Jul 26, 2023

Fixes #93
This adds multiple sound playing support by storing sound raw data and playing the data with pointers on demand.
However, if the algorithm is not handled appropriately, the sound level may be lowered for some cases (More Info). The original trial is to use arithmetic average of values for each stream, but even if it is root-mean-square or similar, the sound level cannot be considered. In the second trial, I tried to use the algorithm I found, which means to be useable, but not at all because some clipping can still be formed. Fortunately, I am able to write an algorithm based on an article talking about the base value should just be the average value of the values, but eventually with dynamic range compression. This can interestingly mix the signals in-range, and also with suitable compression factors on corresponding values, although the calculation is made more complicated.

Reference:

@BenCheung0422 BenCheung0422 changed the title Add multiple clip support Add multiple clip playing support Jul 26, 2023
@Litorom
Copy link
Member

Litorom commented Mar 11, 2024

Can you please resolve the conflicts here. Thanks

# Conflicts:
#	src/client/java/minicraft/core/io/Sound.java
@BenCheung0422
Copy link
Member Author

Conflicts resolved.

@Litorom Litorom merged commit 17a0c20 into MinicraftPlus:main Apr 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Item pickup sound bug
3 participants