I'm using libVLC in a .NET application (C#) and it works like a charm!
Now I want to use the audiobargraph filter but it doesn't work.
I'm using libVLC this way :
VlcInstance class
Code: Select all
internal IntPtr Handle;
public VlcInstance()
{
List<string> vlcArgs = new List<string>();
vlcArgs.Add("--audio-filter=audiobargraph_a");
vlcArgs.Add("--audiobargraph_a-bargraph=1");
vlcArgs.Add("--sub-source=audiobargraph_v");
this.Handle = LibVlc.libvlc_new(vlcArgs.Count, vlcArgs.ToArray());
if (this.Handle == IntPtr.Zero)
throw new VlcException();
}
Code: Select all
internal IntPtr Handle;
public VlcMediaPlayer(VlcInstance instance)
{
if (instance.Handle != IntPtr.Zero)
this.Handle = LibVlc.libvlc_media_player_new(instance.Handle);
if (Handle == IntPtr.Zero)
throw new VlcException();
}
private IntPtr _pDrawable;
public IntPtr Drawable
{
get { return _pDrawable; }
set {
if (Handle != IntPtr.Zero)
{
LibVlc.libvlc_media_player_set_hwnd(Handle, value);
_pDrawable = value;
}
else
throw new VlcException();
}
}
public VlcMedia Media
{
get
{
IntPtr media = LibVlc.libvlc_media_player_get_media(Handle);
if (media == IntPtr.Zero) return null;
return new VlcMedia(media);
}
set { LibVlc.libvlc_media_player_set_media(Handle, value.Handle); }
}
Code: Select all
internal IntPtr Handle;
public VlcMedia(VlcInstance instance)
{
this.Handle = LibVlc.libvlc_media_new_as_node(instance.Handle, "mediaName");
if (Handle == IntPtr.Zero)
throw new VlcException();
}
Code: Select all
using (VlcMedia media = new VlcMedia(_vlcInstance, url))
{
if (_vlcPlayer == null)
_vlcPlayer = new VlcMediaPlayer(media);
else
_vlcPlayer.Media = media;
}
_vlcPlayer.Drawable = PreviewPictureBox.Handle;
_vlcPlayer.Play();
I've started vlc with the same args and it works flawlessly:
Code: Select all
vlc "rtp://@239.239.239.239:51416" --audio-filter=audiobargraph_a --audiobargraph_a-bargraph=1 --sub-source=audiobargraph_v
Am I doing something wrong? Is it possible to use audiobargraph in libVLC? If not, anybody got a workaround to integrate audiobargraph in .NET application?
Many thanks,
ampi.