CiscoTheProot/rpi/micTest.py
CiscoTheWolf ab34ad2455 Moved ProotState to own file.
Moved Point2D to own file.
Added caching for parsed images.
2023-05-29 20:09:29 +02:00

12 lines
No EOL
342 B
Python

# Print out realtime audio volume as ascii bars
import sounddevice as sd
import numpy as np
def callback(indata: np.ndarray, outdata: np.ndarray, frames: int, time, status) -> None:
print(indata.shape)
volume_norm = np.linalg.norm(indata)*10
print ("|" * int(volume_norm))
with sd.Stream(callback=callback):
sd.sleep(10000)