LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ALSA mono output - how to make? (https://www.linuxquestions.org/questions/linux-newbie-8/alsa-mono-output-how-to-make-815094/)

Mr. Alex 06-19-2010 06:43 AM

ALSA mono output - how to make?
 
Mint 9, Gnome. No PulseAudio, just ALSA. How do I switch audio output from stereo to mono and from mono to stereo again? Please don't tell me to install PulseAudio, I don't want to.

keithieopia 06-19-2010 11:50 PM

I don't blame you for not wanting PulseAudio! :D

Anyway create/edit ~/.asoundrc and place the following in it:
Quote:

pcm.card0 {
type hw
card 0
}
pcm.mono {
type route
slave.pcm card0
slave.channels 2
ttable.0.0 0.5
ttable.0.1 0.5
ttable.1.0 0.5
ttable.1.1 0.5
}
This creates a virtual soundcard (or the correct term is: "slave") named "mono". You can then play anything you want in mono by selecting it. For instance the following two commands will create very different output (the Noise.wav is probably in a different location on your machine):
Quote:

aplay -D mono /usr/share/sounds/alsa/Noise.wav
aplay -D default /usr/share/sounds/alsa/Noise.wav
If you want the default to be in mono, add the following in addition to what you added to .asoundrc before.
Quote:

pcm.!default {
type route
slave.pcm card0
slave.channels 2
ttable.0.0 0.5
ttable.0.1 0.5
ttable.1.0 0.5
ttable.1.1 0.5
}
NOTE: You'll probably have to restart ALSA or logout and back in again.

Mr. Alex 07-21-2010 03:08 AM

Where should I choose the sound card? "gstreamer-properties"? But there's no "mono" soundcard...


All times are GMT -5. The time now is 05:42 AM.