View  Edit  Attributes  History  Attach  Print  Search

ACCUEIL | ARDUINO > S'INSTALLER > DEBUTER > APPROFONDIR | PROCESSING | MECATRONIQUE | MATERIEL | OUTILS | TESTS | Plus...|
Python > Shell > ATELIERS Python + Qt > PyQt apps > PyQt+Arduino | Mes Robots | RepRap | Mes lib'Arduino | Mes shields Arduino | Mes distros | Les Mini-PC |
ATELIERS ARDUINO| VIDEOS | COMPRENDRE | REFERENCES | CODER | TECHNIQUE | GNU/LINUX | LIENS | Rien à voir |

Gnu/Linux : Ligne de commande : contrôler le volume en ligne de commande

Pour contrôler le volume du son en ligne de commande, on peut utiliser amixer.

Liens utiles

Doc

$ man amixer

Exemples


Pour régler le volume principal de la carte 0 en baissant de 5 décibel

$ amixer -c 0 sset "Master,0" 5-

amixer -c 0 sset Master,0 100% unmute

amixer -c 0 sset Master,0 70%


   Example #1:
              amixer -c 1 sset Line,0 80%,40% unmute cap

              will set the second  soundcard's  left  line  input
              volume  to  80% and right line input to 40%, unmute
              it, and select it as a source for capture  (record­
              ing).

   Example #2:
              amixer  -c  2  cset iface=MIXER,name='Line Playback
              Volume",index=1 40%

              will set the third soundcard's second line playback
              volume(s) to 40%

   Example #3:
              amixer -c 2 cset numid=34 40%

              will set the 34th soundcard element to 40%

Pour connaître l'état d'un contrôle simple

$ amixer sget Master,0

ce qui donne par exemple :


Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 22 [71%] [-13.50dB] [on]
 

Pour connaître l'état des interfaces sons du système

$ amixer

ce qui donne par exemple :


Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
  Playback channels: Mono
  Limits: Playback 0 - 31
  Mono: Playback 21 [68%] [-15.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pswitch penum
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'Speaker',0
  Capabilities: pswitch penum
  Playback channels: Front Left - Front Right
  Mono:
  Front Left: Playback [on]
  Front Right: Playback [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 252 [99%] [0.60dB]
  Front Right: Playback 252 [99%] [0.60dB]

(...)
 

Pour avoir la liste des contrôles simples disponibles

$ amixer scontrols

ce qui donne par exemple :

Simple mixer control 'Master',0
Simple mixer control 'Headphone',0
Simple mixer control 'Speaker',0
Simple mixer control 'PCM',0
Simple mixer control 'Front',0
Simple mixer control 'Front Mic',0
Simple mixer control 'Front Mic Boost',0
Simple mixer control 'Surround',0
Simple mixer control 'Center',0
Simple mixer control 'LFE',0
Simple mixer control 'Side',0
Simple mixer control 'Line',0
Simple mixer control 'Mic',0
Simple mixer control 'Mic Boost',0
Simple mixer control 'IEC958',0
Simple mixer control 'IEC958 Default PCM',0
Simple mixer control 'IEC958',1
Simple mixer control 'Beep',0
Simple mixer control 'Capture',0
Simple mixer control 'Capture',1
Simple mixer control 'Input Source',0
Simple mixer control 'Input Source',1

Pour avoir la description des contrôles disponibles

$ amixer controls

ce qui donne par exemple :


numid=35,iface=MIXER,name='Master Playback Switch'
numid=34,iface=MIXER,name='Master Playback Volume'
numid=12,iface=MIXER,name='Headphone Playback Switch'
numid=40,iface=MIXER,name='PCM Playback Volume'
numid=20,iface=MIXER,name='Front Mic Boost'
numid=16,iface=MIXER,name='Front Mic Playback Switch'
numid=15,iface=MIXER,name='Front Mic Playback Volume'
numid=2,iface=MIXER,name='Front Playback Switch'
numid=1,iface=MIXER,name='Front Playback Volume'
numid=4,iface=MIXER,name='Surround Playback Switch'
numid=3,iface=MIXER,name='Surround Playback Volume'
numid=7,iface=MIXER,name='Center Playback Switch'
numid=5,iface=MIXER,name='Center Playback Volume'
numid=8,iface=MIXER,name='LFE Playback Switch'
numid=6,iface=MIXER,name='LFE Playback Volume'
numid=18,iface=MIXER,name='Line Playback Switch'
numid=17,iface=MIXER,name='Line Playback Volume'
numid=19,iface=MIXER,name='Mic Boost'
numid=14,iface=MIXER,name='Mic Playback Switch'
numid=13,iface=MIXER,name='Mic Playback Volume'