Search code examples
delphiaudiopascallazaruslibvlc

How to disable active audio tracks in the paslibvlc video player


I am using the "paslibvlc" lib for playing videos on the lazarus and need to use the mute function. When looking at the documentation, more specifically the "libvlc_audio_set_mute ()" statement I noticed that for transmissions that use digital passthrough (in my case HDMI) the function may not be applicable and audio tracks should be disabled.

Warning
This function does not always work. If there is no active audio stream stream, the mute status might not be available. If digital pass-through (S / PDIF, HDMI ...) is in use, muting may be unapplicable. Also some audio output plugins do not support muting at all. To force silent playback, disable all audio tracks. This is more efficient and reliable than mute.

I have not found how to disable audio tracks. How can I do?

Follow the documentation:

https://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html


Solution

  • libvlc_audio_set_track(mediaPlayerReference, -1)

    https://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html#gae013e4cf0ae73c093f1a1da1af765d21