Update Audio FFT example.

* Note this works with the newer ulab that's not updated yet.
This commit is contained in:
iabdalkader 2020-11-27 01:47:35 +02:00
parent 7e2df49c5b
commit 730eb33de4

View File

@ -31,7 +31,7 @@ def draw_audio_bar(img, level, offset):
fb.draw_rectangle(SIZE+offset, SIZE - ((i+1)*blk_size) + blk_space, 20, blk_size - blk_space, color, 1, True) fb.draw_rectangle(SIZE+offset, SIZE - ((i+1)*blk_size) + blk_space, 20, blk_size - blk_space, color, 1, True)
while (True): while (True):
if (raw_buf): if (raw_buf != None):
pcm_buf = np.frombuffer(raw_buf, dtype=np.int16) pcm_buf = np.frombuffer(raw_buf, dtype=np.int16)
raw_buf = None raw_buf = None
fft_buf = sp.signal.spectrogram(pcm_buf[0::2]) fft_buf = sp.signal.spectrogram(pcm_buf[0::2])