Page 1 of 1

libvlc_audio_set_channel help

Posted: 11 Nov 2010 00:09
by anhlunnhaque
Hello,

I am trying to toggle the libvlc_audio_set_channel from Left to Right in C#. But I am not sure I understands the vlc documents correctly. It says

libvlc_audio_set_channel (libvlc_media_player_t *p_mi, int channel)
Set current audio channel.

But isn't channels are L or R? but the parameter is an int for channel. So how can pass L or R for Left or Right channel respectively to it if it's asking for an int?

This is what I current have:

Code: Select all

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)] [SuppressUnmanagedCodeSecurity] public static extern int libvlc_audio_set_channel(IntPtr libvlc_mediaplayer, int i_channel);

Re: libvlc_audio_set_channel help

Posted: 15 Nov 2010 00:40
by calanor
From http://www.videolan.org/developers/vlc/ ... audio.html

Code: Select all

Audio channels. Enumerator: libvlc_AudioChannel_Error libvlc_AudioChannel_Stereo libvlc_AudioChannel_RStereo libvlc_AudioChannel_Left libvlc_AudioChannel_Right libvlc_AudioChannel_Dolbys
And a question.
Its possible the mute of only one channel ( L or R ) ?

Re: libvlc_audio_set_channel help

Posted: 15 Nov 2010 06:37
by anhlunnhaque
@calanor

Do you mind post a snippet code on how to use it? I want to hear only my Right channel. How do I use libvlc_AudioChannel_Right ??

Thanks!

Re: libvlc_audio_set_channel help

Posted: 15 Nov 2010 11:00
by sherington
Isn't it something like:

Code: Select all

libvlc_audio_set_channel(mediaplayer, libvlc_audio_output_channel_t.libvlc_AudioChannel_Right);
The second int parameter is simply obtained from the enum.

(I'm a Java person so the syntax above may not be 100% correct, but you get the idea.)

Re: libvlc_audio_set_channel help

Posted: 16 Nov 2010 06:27
by anhlunnhaque
sorry, I am not sure I get the idea. Does anybody knows how to do this??

Anybody??

Re: libvlc_audio_set_channel help

Posted: 16 Feb 2012 07:34
by jacobs1
I know it is an old topic, but has anyone managed to set the channel from .net ? how ?