如何在 paslibvlc 视频播放器中禁用活动音轨

How to disable active audio tracks in the paslibvlc video player

我正在使用"paslibvlc"库在lazarus上播放视频,需要使用静音功能。 在查看文档时,更具体地说是 "libvlc_audio_set_mute ()" 声明,我注意到对于使用数字直通(在我的例子中是 HDMI)的传输,该功能可能不适用,应该禁用音轨。

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.

我还没有找到如何禁用音轨。我该怎么办?

遵循文档:

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

libvlc_audio_set_track(mediaPlayerReference, -1)

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