reverted sound meter

This commit is contained in:
Kattni Rembor 2018-05-31 17:38:25 -04:00
parent 1303d5384c
commit 6b2d8d50ec

View file

@ -19,14 +19,13 @@ def normalized_rms(values):
return math.sqrt(sum(float(sample - minbuf) *
(sample - minbuf) for sample in values) / len(values))
# For CircuitPython 2.x:
mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
frequency=16000, bit_depth=16)
# For CircuitPython 3.0 and up, "frequency" is now called "sample_rate".
# For Circuitpython 3.0 and up, "frequency" is now called "sample_rate".
# Comment the lines above and uncomment the lines below.
# mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
# sample_rate=16000, bit_depth=16)
#mic = audiobusio.PDMIn(board.MICROPHONE_CLOCK, board.MICROPHONE_DATA,
# sample_rate=16000, bit_depth=16)
samples = array.array('H', [0] * 160)