diff options
author | Benjamin 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) |
commit | 62fb8d0227bf8976b27afe8acbef155b7da37ce4 (patch) | |
tree | 9a1831065aadd8a2f2d98ff25233cfc2d92ba372 /arange.py | |
parent | 962a6cd2f8e32ad68acfbd833860053e84f03413 (diff) |
Fixed Deadlock and File Error
Diffstat (limited to 'arange.py')
-rwxr-xr-x | arange.py | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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) |