Can I downmix stereo audio to mono?
I have one speaker next to my computer which I use mostly as a headphone amplifier. On occasion I need to use it as a loudspeaker. Is it possible to quickly change the audio output from stereo to mono, either system-wide or as a plugin for a media player?
-
Find the name of your audio sink by running
pacmd list-sinks | grep name:
-
Then run this command (taking care to remove the angled brackets from the result of previous command):
pacmd load-module module-remap-sink sink_name=mono master=NAME_OF_AUDIO_SINK_GIVEN_BY_PREVIOUS_COMMAND channels=2 channel_map=mono,mono
or add
load-module module-remap-sink sink_name=mono master=NAME_OF_AUDIO_SINK_GIVEN_BY_PREVIOUS_COMMAND channels=2 channel_map=mono,mono
to /etc/pulse/default.pa
to have it run at startup.
-
Then in Sound Preferences choose "Mono" as the output, but remember to reduce volumes by half, since two channels are getting mixed into one, or else you'll have distortion. To test, run:
speaker-test -c 2 -t sine
Same thing in a single command:
pacmd load-module module-remap-sink sink_name=mono master=$(pacmd list-sinks | grep -m 1 -oP 'name:\s<\K.*(?=>)') channels=2 channel_map=mono,mono
-
To remove the mono channel, just use:
pacmd unload-module module-remap-sink
I've cast answer 1 into a perl-script, so I don't need to remember these 2 commands:
#!/usr/bin/perl
use strict;
my @choices = ();
my $i = 0;
for (`pacmd list-sinks`) {
if( /name:.*<(.+)>/) {
$choices[$i++] = $1;
print "$i:\t$1\n";
}
}
my $choice = $choices[<>-1] or die "invalid choice";
exec (qw(pacmd load-module module-remap-sink sink_name=mono),
"master=$choice",
qw(channels=2 channel_map=mono,mono));
(I would've annotated that answer, but my karma is to low ;-) )
If you are using jack, then you can do so using patchage(which can be installed with apt-get install patchage
). It has a very intuitive interface.