mirror of
https://github.com/larsimmisch/pyalsaaudio.git
synced 2026-05-30 01:47:01 +00:00
mixertest.py: print capture volume
This commit is contained in:
+8
-3
@@ -72,8 +72,13 @@ def show_mixer(name, kwargs):
|
|||||||
volumes = mixer.getvolume()
|
volumes = mixer.getvolume()
|
||||||
volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB)
|
volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB)
|
||||||
for i in range(len(volumes)):
|
for i in range(len(volumes)):
|
||||||
print("Channel %i volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
|
print("Channel %i playback volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
|
||||||
|
|
||||||
|
volumes = mixer.getvolume(pcmtype=alsaaudio.PCM_CAPTURE)
|
||||||
|
volumes_dB = mixer.getvolume(pcmtype=alsaaudio.PCM_CAPTURE, units=alsaaudio.VOLUME_UNITS_DB)
|
||||||
|
for i in range(len(volumes)):
|
||||||
|
print("Channel %i capture volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mutes = mixer.getmute()
|
mutes = mixer.getmute()
|
||||||
for i in range(len(mutes)):
|
for i in range(len(mutes)):
|
||||||
@@ -113,7 +118,7 @@ def set_mixer(name, args, kwargs):
|
|||||||
mixer.setmute(1, channel)
|
mixer.setmute(1, channel)
|
||||||
else:
|
else:
|
||||||
mixer.setmute(0, channel)
|
mixer.setmute(0, channel)
|
||||||
|
|
||||||
elif args in ['rec','unrec']:
|
elif args in ['rec','unrec']:
|
||||||
# Enable/disable recording
|
# Enable/disable recording
|
||||||
if args == 'rec':
|
if args == 'rec':
|
||||||
|
|||||||
Reference in New Issue
Block a user