Skip to content

SetAudioFormatCallback and SetAudioCallbacks don't seem to work

Summary

I am trying to get the raw audio data for the playback by setting up the audio callbacks on the MediaPlayer instance, based on example here: https://code.videolan.org/mfkl/libvlcsharp-samples/-/blob/master/AudioCallbacks/Program.cs

I've setup a basic test by modifying the MinimalPlayback.cs file included with the Unity package, but none of the events seem to be ever called.

Minimal project and steps to reproduce

MinimalPlayback.cs

  1. Replace the MinimalPlayback.cs in the example with the file above.
  2. Run the project, notice that the debug_message that's being logged to the Console stays "Null", meaning that none of the audio callbacks were ever called

What is the current bug behavior?

Callbacks setup through SetAudioFormatCallback and SetAudioCallbacks are never called.

What is the expected correct behavior?

Those callbacks would be called and provided with the audio data from the multimedia that's being played.

Does it work on other plaforms? Does it work with the official VLC apps?

I've ran the AudioCallbacks sample on my PC (Windows, same as environment below) outside of Unity and this works correctly, with the callbacks being called as expected.

Relevant logs and/or screenshots

Nothing to log

Environment

  • OS: Windows 10
  • Version 10.0.18363
  • Device: PC (Intel)
  • LibVLC version and architecture 4.0.0-dev Otto Chriek, x64
  • LibVLCSharp version (not sure where to check, same as included in the Unity plugin from Asset Store)
  • VLC Unity plugin version 0.0.9