Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/arange.py
diff options
context:
space:
mode:
authorBenjamin Schwartz <bens@alum.mit.edu>2007-10-02 17:42:00 (GMT)
committer Benjamin Schwartz <bens@alum.mit.edu>2007-10-02 17:42:00 (GMT)
commit62fb8d0227bf8976b27afe8acbef155b7da37ce4 (patch)
tree9a1831065aadd8a2f2d98ff25233cfc2d92ba372 /arange.py
parent962a6cd2f8e32ad68acfbd833860053e84f03413 (diff)
Fixed Deadlock and File Error
Diffstat (limited to 'arange.py')
-rwxr-xr-xarange.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/arange.py b/arange.py
index 0f1e135..0d537e4 100755
--- a/arange.py
+++ b/arange.py
@@ -219,11 +219,17 @@ def start_recording_alsa():
rec_process = subprocess.Popen(["/usr/bin/arecord", "--file-type=raw", "--channels=1", "--format=S16_LE", "--rate=48000", fname])
- while not os.path.exists(fname):
- time.sleep(0.02)
-
- while os.path.getsize(fname) <= 0:
- time.sleep(0.02)
+# while not os.path.exists(fname):
+# time.sleep(0.02)
+#
+# while os.path.getsize(fname) <= 0:
+# time.sleep(0.02)
+ s = 0
+ while s <= 0:
+ try:
+ s = os.path.getsize(fname)
+ except os.error:
+ time.sleep(0.02)
#f = open(fname,'rb')
return (rec_process, f)