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

[HL] some sample rate fixes #1383

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

MoritzBrueckner
Copy link
Contributor

@MoritzBrueckner MoritzBrueckner commented Dec 21, 2021

If the system falls back to an alternative mix format with a different sample rate than preferred by Kinc, it could happen that the sample rate in the Haxe API wasn't correctly updated because it it was read before the audio was initialized.

Also, audio buffers used a hard-coded sample rate which would fail in the same situation. This would lead to playback with a wrong speed because the resampling code in resampling audio channels depends on the sample rate passed here.

Btw, what's the reason why the sample rate is stored in each buffer when it's also a globally accessible variable? Are the buffers designed to be used for multiple purposes?

On Krom there are similar issues but I couldn't get Krom audio to work even after enabling it in main.cpp (see Kode/Krom#138 (comment); I know of the issues because they exist in Armorcore and they are likely to exist in Kode/Krom as well). I will try to dig deeper in the next days and then eventually open an issue or add something to the linked issue.

@RobDangerous RobDangerous merged commit ac11ec4 into Kode:master Dec 22, 2021
@MoritzBrueckner MoritzBrueckner deleted the fix-hl-samplerate branch December 22, 2021 17:51
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.

2 participants