Page 1 of 1

play audio to only one speaker left/right from commandline

Posted: 13 Feb 2012 17:10
by jacobs1
Is it possible to make vlc play audio to only one of the speakers left/right from commandline ?

Re: play audio to only one speaker left/right from commandli

Posted: 17 Feb 2012 04:18
by xomby
MAYBE...

From http://www.videolan.org/doc/play-howto/en/ch04.html

--audio-channel <integer> specifies the default audio channel to use with dvds.
vlc.audio.channel : an integer between 1 and 5 that indicates which audio channel mode is used, values can be: "1=stereo", "2=reverse stereo", "3=left", "4=right", "5=dolby". Use vlc.audio.channel to check if setting of the new audio channel has succeeded. (supported in vlc version > 0.8.6)
or
--mono forces VLC to treat the stream in mono audio. (might help, doubt it)

but really probably not.
If you're on linux/windows you might be able to use a BAT file to mute left/right audio output for the whole computer...
http://forums.techguy.org/windows-xp/66 ... batch.html
This is a good place to start, it primarily deals with muting, but if you can mute, you can probably adjust left/right balance too.

Re: play audio to only one speaker left/right from commandli

Posted: 17 Feb 2012 08:55
by carelljones
Audio options
--noaudio disables audio output. Note that if you are streaming (ex: to a file) this has no effect (streaming copies the audio verbatim). Use --sout-xxx instead (ex: --no-sout-audio)
--mono forces VLC to treat the stream in mono audio.
--volume <integer> sets the level of audio output (between 0 and 1024). Also only applies to local playback (like --noaudio).
--aout-rate <integer> sets the audio output frequency (Hz). By default, VLC will try to autodetect this.
--desync <integer> compensates desynchronization of audio (ms). (If audio and video streams are not synchronized, use this setting to delay the audio stream)
--audio-filter <string> adds audio filters to the processing chain. Available filters are visual (visualizer with spectrum analyzer and oscilloscope), headphone (virtual headphone patialization) and normalizer (volume normalizer)

Re: play audio to only one speaker left/right from commandli

Posted: 17 Feb 2012 09:17
by Rémi Denis-Courmont
It should be possible with the new audio remap filter in VLC 2.0. Refer to CLI help for documentation.

Re: play audio to only one speaker left/right from commandli

Posted: 17 Feb 2012 10:21
by jacobs1
Thank you for trying to help,
muting left/right audio for the whole computer wont help because I need to be able to run 2 processes that uses libvlc and one process will play to the right speaker and the other to the left speaker at the same time.

--audio-channel doesn't help, I am playing a udp stream input.

I also tried audio remap filter in VLC 2.0, it looked promising but didn't do the trick also, maybe I am using it wrong. how is it used properly as a vlc command ?

vlc.audio.channel looks like what I need but it doesn't work ( I tried version 1.1.10 and 2.0 ), when running the function libvlc_audio_set_channel I get result 0 and nothing changes ( I also tried libvlc_audio_get_channel and it returns -1 )

Audio Balancing seemed like a trivial feature to me I am surprised it proves to be very difficult .
Please help me out here.

Re: play audio to only one speaker left/right from commandli

Posted: 17 Feb 2012 14:38
by Rémi Denis-Courmont
In general, you can't do that. The audio hardware does not expose two independent channels, but two synchronized channels.
Besides, there would be no sane way to synchronize the channels if they were written by separate applications.


Your architecture that is broken here, not LibVLC.

Re: play audio to only one speaker left/right from commandli

Posted: 17 Feb 2012 15:01
by jacobs1
"there would be no sane way to synchronize the channels if they were written by separate applications"
I don't need them synchronized, I am talking about 2 processes playing 2 different video ( sometimes at the same time, not always )
the scenario is a machine connected to 2 speakers each one in a different room, and the app should be able to selectively play to any one of the channels.
"The audio hardware does not expose two independent channels"
all I need a an option that I can play audio that has 2 channels but one is silent, just like stereo only here one side (L/R) is silent.

Isn't this what libvlc_audio_set_channel supposed to do ?

Thanks again for your help.

Re: play audio to only one speaker left/right from commandli

Posted: 05 Mar 2012 00:01
by jessestmichael
Ok... if you play the song "New orleans is sinking" by the tragically hip, for example, the rhythm guitar is on the left side and the lead guitar is on the right side. If i want to learn each part separately i want to adjust it so i only hear a particular side. If you play it in (sorry to swear here) Winamp it will allow u to go left or right. I want VLC to do this as well.

Any help would be great...

Re: play audio to only one speaker left/right from commandli

Posted: 05 Mar 2012 08:25
by Lotesdelere
the rhythm guitar is on the left side and the lead guitar is on the right side. If i want to learn each part separately i want to adjust it so i only hear a particular side. If you play it in (sorry to swear here) Winamp it will allow u to go left or right.
Menu Audio -> Audio channels

Re: play audio to only one speaker left/right from commandli

Posted: 07 Mar 2012 02:42
by jessestmichael
Lotesdelere

Holy Poop!!! I have been looking everywhere in the advanced controls... I feel so dumb.. and i am not really a total noob.... Thanks a million man.