-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Increased accuracy when getting current audio time using OpenAL SOFT on native #1759
base: develop
Are you sure you want to change the base?
Conversation
cleaned up the whitespacing, and removed those unneeded public vars 🤝 |
Maybe a define needs to be added as openal soft is not on ios or lime should add support for openal soft on ios. |
OpenAL SOFT is not supported for |
OpenAL SOFT is LGPL, so as I understand it, it must be dynamically linked. |
Makes sense, but still OpenAL SOFT needs iOS fixes/patches |
First time writing some bindings stuff! so feel free to tell me where I might need to clean up things. (i will clean up random whitespace / imports changes in the morning, bwah!)
wrote some bindings for
al_get_sourcedv_soft
and broadly followed along side theget_sourcefv
stuff.Using openal soft extension, can get a more precise time of the current playing audio.
Using ninjamuffin99/Lime-Time as sample / benchmark.
(the graphs here are sorta "right to left", and loop back to the bottom every 1000ms.)
stats.update(FlxG.sound.music.time % 1000);
Before (60FPS)
The timing of the audio 'plateaus' a bit for at least a frame, which may not seem like much, however this is an issue if you were to attempt to get the current playing time from BETWEEN a frame (say, on a keyboard input via an event listener) or on higher framerates (my demo is at 60fps)
After (60FPS)
The values here are ALWAYS being incremented, due to higher precision. No 'plateau' effect.