Skip to content

Commit d5e81f2

Browse files
committed
mixertest.py: print capture volume
1 parent 8f7e8fb commit d5e81f2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mixertest.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ def show_mixer(name, kwargs):
7272
volumes = mixer.getvolume()
7373
volumes_dB = mixer.getvolume(units=alsaaudio.VOLUME_UNITS_DB)
7474
for i in range(len(volumes)):
75-
print("Channel %i volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
76-
75+
print("Channel %i playback volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
76+
77+
volumes = mixer.getvolume(pcmtype=alsaaudio.PCM_CAPTURE)
78+
volumes_dB = mixer.getvolume(pcmtype=alsaaudio.PCM_CAPTURE, units=alsaaudio.VOLUME_UNITS_DB)
79+
for i in range(len(volumes)):
80+
print("Channel %i capture volume: %i%% (%.1f dB)" % (i, volumes[i], volumes_dB[i] / 100.0))
81+
7782
try:
7883
mutes = mixer.getmute()
7984
for i in range(len(mutes)):
@@ -113,7 +118,7 @@ def set_mixer(name, args, kwargs):
113118
mixer.setmute(1, channel)
114119
else:
115120
mixer.setmute(0, channel)
116-
121+
117122
elif args in ['rec','unrec']:
118123
# Enable/disable recording
119124
if args == 'rec':

0 commit comments

Comments
 (0)