reverted sound meter
This commit is contained in:
parent
1303d5384c
commit
6b2d8d50ec
1 changed files with 3 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue