File tree 1 file changed +5
-5
lines changed
adafruit_circuitplayground
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ def __init__(self) -> None:
61
61
sample_rate = 16000 ,
62
62
bit_depth = 16 ,
63
63
)
64
- self ._samples = None
64
+ self ._mic_samples = None
65
65
66
66
@staticmethod
67
67
def _normalized_rms (values ) -> float :
@@ -91,10 +91,10 @@ def sound_level(self) -> float:
91
91
while True:
92
92
print(cpb.sound_level)
93
93
"""
94
- if self ._sample is None :
95
- self ._samples = array .array ("H" , [0 ] * 160 )
96
- self ._mic .record (self ._samples , len (self ._samples ))
97
- return self ._normalized_rms (self ._samples )
94
+ if self ._mic_samples is None :
95
+ self ._mic_samples = array .array ("H" , [0 ] * 160 )
96
+ self ._mic .record (self ._mic_samples , len (self ._mic_samples ))
97
+ return self ._normalized_rms (self ._mic_samples )
98
98
99
99
def loud_sound (self , sound_threshold : int = 200 ) -> bool :
100
100
"""Utilise a loud sound as an input.
You can’t perform that action at this time.
0 commit comments