File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def update_plot(frame):
8686 device_info = sd .query_devices (args .device , 'input' )
8787 args .samplerate = device_info ['default_samplerate' ]
8888
89- length = np . ceil (args .window * args .samplerate / (1000 * args .downsample ))
89+ length = int (args .window * args .samplerate / (1000 * args .downsample ))
9090 plotdata = np .zeros ((length , len (args .channels )))
9191
9292 fig , ax = plt .subplots ()
Original file line number Diff line number Diff line change 22"""Show a text-mode spectrogram using live microphone data."""
33import argparse
44import logging
5+ import math
56import numpy as np
67import shutil
78
@@ -63,8 +64,8 @@ def int_or_str(text):
6364 samplerate = sd .query_devices (args .device , 'input' )['default_samplerate' ]
6465
6566 delta_f = (high - low ) / (args .columns - 1 )
66- fftsize = np .ceil (samplerate / delta_f ). astype ( int )
67- low_bin = np .floor (low / delta_f )
67+ fftsize = math .ceil (samplerate / delta_f )
68+ low_bin = math .floor (low / delta_f )
6869
6970 cumulated_status = sd .CallbackFlags ()
7071
You can’t perform that action at this time.
0 commit comments