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

Increased accuracy when getting current audio time using OpenAL SOFT on native #1759

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

ninjamuffin99
Copy link
Contributor

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 the get_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)

image
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)

image
The values here are ALWAYS being incremented, due to higher precision. No 'plateau' effect.

@ninjamuffin99
Copy link
Contributor Author

cleaned up the whitespacing, and removed those unneeded public vars 🤝

@mcagabe19
Copy link

openal soft gives null object referance at iOS
IMG_3256

@SomeGuyWhoLovesCoding
Copy link

openal soft gives null object referance at iOS IMG_3256

Ikr? LMAO 🤣

@MAJigsaw77
Copy link
Contributor

Maybe a define needs to be added as openal soft is not on ios or lime should add support for openal soft on ios.

@mcagabe19
Copy link

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 static_link or for iOS itself so lime needed add support for it

@joshtynjala
Copy link
Member

OpenAL SOFT is not supported for static_link or for iOS itself so lime needed add support for it

OpenAL SOFT is LGPL, so as I understand it, it must be dynamically linked.

@mcagabe19
Copy link

OpenAL SOFT is LGPL, so as I understand it, it must be dynamically linked.

Makes sense, but still OpenAL SOFT needs iOS fixes/patches

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.

None yet

6 participants