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

Audio looping fix #2579

Merged
merged 5 commits into from
Jul 29, 2022
Merged

Audio looping fix #2579

merged 5 commits into from
Jul 29, 2022

Conversation

veins1
Copy link
Contributor

@veins1 veins1 commented Jul 16, 2022

An incomplete (non)fix for #2228. Handling only WAVs. Logic is the same for other formats but I didn't want to copy-paste, there's probably a better solution. First PR in my life!

@veins1 veins1 changed the title WAVs looping fix. But broke other formats looping Audio looping fix Jul 17, 2022
@veins1
Copy link
Contributor Author

veins1 commented Jul 17, 2022

Decided to fix other formats by copy-pasting. Maybe it's not too bad. I believe all formats work correctly now. Can't really test short XM and MOD files ( I don't know where to get them), but full songs loops work.

@raysan5
Copy link
Owner

raysan5 commented Jul 18, 2022

@veins1 thanks for the review. I tested it with the provided VS2022 project (MSVC compiler) and compilation failed with multiple errors, related to the void * casting while reading the audio data from file, maybe you tested it compiling as C++? what compiler did you use?

I reviewed the lines and when playing there is no stuttering but I can hear some cracks, did you experienced the same issue?

Also note the PR is not following the raylib coding conventions, please, could you review it?

@veins1
Copy link
Contributor Author

veins1 commented Jul 18, 2022

@raysan5 I'm using the MinGW with notepad++ scripts which are included in raylib Windows Installer.
I hear the cracks too. If I set target fps higher than 30, the crackling is reduced and at 40fps it's completely gone. If I lower it to 1, most of the audio is silence. It's a different issue that was present before and doesn't involve looping.
Hopefully following raylib conventions now.

@raysan5
Copy link
Owner

raysan5 commented Jul 29, 2022

@veins1 I'm merging this fix as a temporal solution but the full audio system should actually be redesigned, as noted in the related issue.

@raysan5 raysan5 merged commit 0ef3e4c into raysan5:master Jul 29, 2022
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