-
-
Notifications
You must be signed in to change notification settings - Fork 377
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 AudioSource.latency #1896
base: 8.3.0-Dev
Are you sure you want to change the base?
Add AudioSource.latency #1896
Conversation
Fix spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS will give null since it uses mojoal
instead if OpenAL SOFT
.
@ACrazyTown Since some platforms might use mojoAl or something else for example, I'd suggest checking if the extension is supported first |
@mcagabe19 @MAJigsaw77 The native C++ functions will return null if lime/src/lime/_internal/backend/native/NativeAudioSource.hx Lines 592 to 599 in 3f9041a
Is that not enough? |
It's not because openal soft can be there, but the platform might not support latency, in any case that check should make it fine if added. |
This PR adds a
latency
field toAudioSource
that returns the estimated playback latency of the sound.On native targets (that use OpenAL Soft) the same method from #1759 is used, although exposing it as a seperate field instead of applying it directly to the sound's time.
HTML5 uses
AudioContext.baseLatency
andAudioContext.outputLatency
In the case where it's not possible to query the playback latency (eg. Flash) 0 is returned.