Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xaudiograb.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/audiograb.py b/audiograb.py
index b169d0f..259b159 100755
--- a/audiograb.py
+++ b/audiograb.py
@@ -394,7 +394,11 @@ class AudioGrab():
p = p[find(p,"Mono:"):]
p = p[find(p,"[")+1:]
p = p[:find(p,"%]")]
- return int(p)
+ try:
+ return int(p)
+ except:
+ # in case alsamixer doesn't report a percentage
+ return 0
def set_sampling_rate(self, sr):
"""Sets the sampling rate of the capture device