Is it possible to make vlc play audio to only one of the speakers left/right from commandline ?
Asked
Active
Viewed 1.5k times
6
-
1I think you can change the audio settings from the OS you use. So, you program this through an OS-specific feature using its system library. I don't think VLC has a feature to control an audio speaker... it only has audio effect filters. Under Windows, VLC uses DirectShow interface to capture all A/V devices. So, you shall use DirectX library to control the audio interface directly. – ee. Feb 15 '12 at 08:14
-
1I need to be able to run 2 processes playing vlc at the same time, one process will play the audio to the left speaker and the other to the right speaker. can this be done with DirectShow ? cant I change the balance played by vlc ( with one of the filters maybe ) ? – jacob Feb 15 '12 at 13:17
-
1What you need is to control L&R audio channels which libVLC seems to expose them but is not present in VLC GUI. In VLC, it allows an audio track of a media to be in *stereo* or *mono* on **both** side of the audio channels for that media player instance. This can be done through `Audio -> Audio Channels` menu option while playing the media. I am not sure if you can specifically control either L or R audio channel via VLC GUI interface. – ee. Feb 16 '12 at 00:43
-
Actualy I am using libvlc ( not the VLC GUI ) with a .net wraper called Vlc.Dotnet. and when I try to set the channel using libvlc_audio_set_channel, nothing changes ( when I try to get the channel with libvlc_audio_get_channel I get 0 ) – jacob Feb 16 '12 at 06:44
-
Check the forum topic for hints http://forum.videolan.org/viewtopic.php?f=32&t=87115 – ee. Feb 16 '12 at 09:00
-
I read this topic and I still cant figure out what is wrong with my code, I am using 1.1.10 and the dotnet wraper is using the correct function signature ( libvlc_audio_get_channel gets a pointer to the playerInstance that was created using libvlc_media_player_new ) – jacob Feb 16 '12 at 12:53
-
I think it is possible.. http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html – Yeo Feb 20 '12 at 20:15
-
@ee. Ubuntu Linux too. You mentioned Windows, so I will mention Ubuntu Linux has a `Sound Setting` to adjust left/right speakers called `Balance`. (I still wish VLC did that natively to be sure it's working, but the System should override VLC correct?) – prosody-Gabe Vereable Context Jan 05 '22 at 01:45
2 Answers
2
If VLC Audio channels is not performing well the most you can do is open a ticket in VLC bug system.
If you can't wait until the issue is fixed just redirect the audio output to STDOUT and use a tool like SOX to do the work for you.
Selecting a Particular Channel with sox:
sox stereo.wav -c 1 mono.wav avg -l
of course sox can work on streams and it's not restricted to files.
BTW, sox comes with play and record utilities that can do the actual playback. see the examples here

Uli Köhler
- 13,012
- 16
- 70
- 120

ApriOri
- 2,618
- 29
- 48
-
streaming to stdout on windows: http://forum.videolan.org/viewtopic.php?f=4&t=57940 – ApriOri Feb 23 '12 at 23:06