diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-09-03 19:51:37 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-09-03 19:51:37 (GMT) |
commit | d6f7a8c7e9a5831bbb6f83f56ff8f3f4bf119ce2 (patch) | |
tree | 172d55e85256dba5ec3713b3f3883fe3ee6573aa | |
parent | 915bb53ecdcada625ee865472e98a0539590e001 (diff) |
exception added for mix-gain inconsistancy
-rwxr-xr-x | audiograb.py | 6 |
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 |