Conversation
Fix spaces
@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. |
04f3b2d to
6b71ec6
Compare
|
If it is problematic to add this to the AudioSource API (as Lime uses 3 different OpenAL backends depending on the configuration and only OpenAL Soft can query latency) would it be better to just reduce this to binding the necessary functions and exposing them in Haxe thru OpenALAudioContext or whatever? If so, would be nice to also review #1912 so the backend specific functions can be hidden behind a proper conditional |
This PR adds a
latencyfield toAudioSourcethat 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.baseLatencyandAudioContext.outputLatencyIn the case where it's not possible to query the playback latency (eg. Flash) 0 is returned.