0

Is there any way to automatically get the audiodelay to set in the videoplayer? It is really annoying to fix it manually every time.

Exoplayer (google native player used in yt) is using the getLatency method, not part of the public SDK (https://github.com/google/ExoPlayer/blob/b5beb32618ac99adc58b537031a6f7c3dd761b9a/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioTrackPositionTracker.java#L172) so I cant replicate this in due to xamarin not including this method in the c# wrapper

var method = typeof(AudioTrack).GetMethod("getLatency"); // => null

(Tried stuff from https://developer.amazon.com/docs/fire-tv/audio-video-synchronization.html#section1-2)

I also tried to find the native bindings the android audiotrack in vlc to get getTimestamp or getPlaybackHeadPosition, but I was unsucessfull.

Is there any way to get the audiodelay caused by bluetooth headphones in xamarin.forms on android?

Is there any way to get the android AudioTrack from libvlc (if that is even used)?

mfkl
  • 1,914
  • 1
  • 11
  • 21
Blue
  • 45
  • 1
  • 7
  • what binding are you using? Libvlcsharp? libvlcjni? exoplayer? Its not clear – mfkl Jan 11 '21 at 01:39
  • Sorry, I am using Libvlcsharp in an xamarin forms project (https://github.com/videolan/libvlcsharp/blob/3.x/src/LibVLCSharp.Forms/README.md) – Blue Jan 11 '21 at 07:51
  • `mediaplayer.SetAudioDelay`? – mfkl Jan 11 '21 at 08:00
  • @mfkl the problem is not SetAudioDelay, I need to get the current audio delay caused by the bluetooth headphones. If I plug in my headphones I have to manually set the audio delay via SetAudioDelay to something like -400ms to make it in sync. Exoplayer offers an automatic audio delay system but not vlc, I am asking how to make it sync automatically like exoplayer – Blue Jan 11 '21 at 10:51

1 Answers1

0

You can't. LibVLC does not offer to detect the latency caused by an external speaker. Your best bet is to manually sync it with SetAudioDelay (or write a libvlc plugin with that feature).

EDIT: Being told by a core dev that latency is handled on all platforms except Android. You might want to test it. In any case, it may happen in a future libvlc android version.

mfkl
  • 1,914
  • 1
  • 11
  • 21