I'm having a problem with the audio properties in LibVLC.
I keep getting the exception: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Here is the code/s:
Code: Select all
[DllImport("libvlc")]
internal static extern void libvlc_audio_toggle_mute(IntPtr p_instance, ref libvlc_exception_t p_exception);
[DllImport("libvlc")]
internal static extern bool libvlc_audio_get_mute(IntPtr p_instance, ref libvlc_exception_t p_exception);
[DllImport("libvlc")]
internal static extern void libvlc_audio_set_mute(IntPtr p_instance, bool status, ref libvlc_exception_t p_exception);
[DllImport("libvlc")]
internal static extern int libvlc_audio_get_volume(IntPtr p_instance, ref libvlc_exception_t p_exception);
[DllImport("libvlc")]
internal static extern void libvlc_audio_set_volume(IntPtr p_instance, int i_volume, ref libvlc_exception_t p_exception);
Code: Select all
public int Volume
{
get
{
VlcException ex = new VlcException();
//bool result = LibVlc.libvlc_audio_get_mute(Handle, ref ex.Ex);
int result = LibVlc.libvlc_audio_get_volume(Handle, ref ex.Ex);
return result;
}
set
{
VlcException ex = new VlcException();
LibVlc.libvlc_audio_set_volume(Handle, value, ref ex.Ex);
}
}