Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

Commit

Permalink
Use a break within the endless loop to quit
Browse files Browse the repository at this point in the history
  • Loading branch information
lgeek committed Apr 16, 2011
1 parent be3b5a8 commit a3b9924
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spectrograph.py
Expand Up @@ -33,9 +33,7 @@
spectrogram = CreateImage((WINDOW_WIDTH, HEIGHT), IPL_DEPTH_16U, 1)
Set(spectrogram, 0)

running = True

while (running):
while (True):
data = stream.read(CHUNK_SIZE)
data = numpy.fromstring(data, 'int16')
freq = numpy.fft.rfft(data)
Expand All @@ -57,7 +55,7 @@

ShowImage("Spectograph", spectrogram)
if (WaitKey(10) == ord('q')):
running = False
break

stream.stop_stream()
stream.close()
Expand Down

0 comments on commit a3b9924

Please sign in to comment.