0

I am starting with the sample LibVLCSharp.WPF.Sample and while it plays my VOB, I cannot change the audio track.

I call SetAudioTrack and it always returns false (and doesn't change). Full VLC lets me change the audio track on the same file just fine.

        var media = new Media(_libVLC, clip.GetEvoPath(playlist), FromType.FromPath);
        var status = await media.Parse();

        _mediaPlayer.Playing += (sender, e) =>
        {
            bool ok = _mediaPlayer.SetAudioTrack(3);
        };

        _mediaPlayer.Play(media);

When should I call this, to get it to work? Ideally I would like to set the stream before I start playback, but that doesn't work either.

ControlAV
  • 194
  • 7
  • What does `AudioTrackCount` give you? – mfkl Aug 26 '19 at 14:14
  • Additionally, if your media is a remote stream, you need to add the `ParseNetwork` option to the `Parse()` call. – mfkl Aug 26 '19 at 16:54
  • Thanks. AudioTrackCount and VideoTrackCount give zero, even though the content plays just fine. The media is a local EVO file from an HD DVD. I tried the ParseNetwork option (and ParseLocal), no difference. – ControlAV Aug 27 '19 at 13:38
  • Check `mediaPlayer.Media.Tracks` but without the file it's hard to help – mfkl Aug 27 '19 at 14:06
  • mediaplayer.Media.Tracks is empty, I get this problem on every EVO file I have tried. I will find a small one and share it, to get you an actionable repro. Thank you for continuing to work with me on this. – ControlAV Aug 28 '19 at 14:34
  • Ok so I uploaded a tiny EVO file that repros the "no track but I play anyway" problem to [link](http://hddvd-faq.com/evotest.zip), thank you for your continued assistance. – ControlAV Sep 02 '19 at 18:47
  • can you see the track info in vlc android or vlc ios? – mfkl Sep 18 '19 at 20:11
  • I don't have any Android and have no idea how to run my code on iOS, so I can't answer that. The PC version of VLC shows them all in the Codec pane though. – ControlAV Sep 22 '19 at 04:41
  • I mean the official VLC apps on those platforms – mfkl Sep 23 '19 at 13:18
  • I understood your question, but without an Android device, and with no way of running my code on iOS, I can't answer that. I did attempt to open it from an http address from the iOS VLC app, but I could not figure out where the stream info is displayed, and the sample is super-short. – ControlAV Sep 25 '19 at 02:24
  • Ok. Your sample seems to have only 1 audio track (and 1 video track) when played in VLC desktop though – mfkl Sep 25 '19 at 11:15
  • This simple sample yes, but the API mediaplayer.Media.Tracks returns nothing. I can't get a non-zero count for the number of streams, on this simple sample or my "real" samples with multiple streams. – ControlAV Sep 25 '19 at 14:26
  • can you provide a sample with multiple streams please? – mfkl Oct 02 '19 at 03:59

0 Answers0