Try to reduce runaway memory usaqe
Try to reduce runaway memory usaqe

file:b/run.bat (new)
--- /dev/null
+++ b/run.bat
@@ -1,1 +1,1 @@
-
+python scannr.py > output.txt

file:a/scannr.py -> file:b/scannr.py
--- a/scannr.py
+++ b/scannr.py
@@ -72,7 +72,9 @@
         wf.setframerate(snd.RATE)
         wf.writeframes(data)
         wf.close()
+        del wf
         print("done - result "+str(len(data))+" frames written to "+path)
+    del data
 
 dispatcher.connect( filenameMaker, signal='SND_STARTED', sender=dispatcher.Any )
 dispatcher.connect( worker, signal='FILE_CREATED', sender=dispatcher.Any )

file:a/snd.py -> file:b/snd.py
--- a/snd.py
+++ b/snd.py
@@ -90,7 +90,6 @@
         data = stream.read(CHUNK_SIZE)
         L = unpack('<' + ('h'*(len(data)/2)), data) # little endian, signed short
         L = array('h', L)
-        LRtn.extend(L)
 
         silent = is_silent(L)
         #print silent, num_silent, L[:10]
@@ -102,6 +101,8 @@
             dispatcher.send( signal='SND_STARTED')
             snd_started = True
             print snd_started
+        if snd_started:
+            LRtn.extend(L)
         if snd_started and num_silent > MAX_SILENT:
             break
 
@@ -127,6 +128,7 @@
     wf.writeframes(data)
     wf.close()
     print("done - result written to "+path)
+    del data