Skip to content

Commit d442e55

Browse files
committed
src: Update test_record.py.
Signed-off-by: Damien George <[email protected]>
1 parent c8d67dc commit d442e55

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/test_record.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@
2222
"00000"
2323
)
2424

25-
RECORDING_RATE = 7812
26-
RECORDING_SECONDS = 5
27-
RECORDING_SIZE = RECORDING_RATE * RECORDING_SECONDS
28-
29-
my_recording = audio.AudioFrame(RECORDING_SIZE)
25+
my_recording = audio.AudioFrame(5000)
3026

3127
while True:
3228
if button_a.is_pressed():
33-
microphone.record_into(my_recording, rate=RECORDING_RATE, wait=False)
29+
microphone.record_into(my_recording, wait=False)
3430
display.show([mouth_open, mouth_closed], loop=True, wait=False, delay=150)
3531
while button_a.is_pressed() and microphone.is_recording():
3632
sleep(50)
@@ -51,7 +47,7 @@
5147
level *= 0.95
5248
display.show(play * min(1, level / 100))
5349
x = accelerometer.get_x()
54-
audio.set_rate(max(2250, scale(x, (-1000, 1000), (2250, 13374))))
50+
my_recording.set_rate(max(2250, scale(x, (-1000, 1000), (2250, 13374))))
5551
sleep(5)
5652
display.clear()
5753
sleep(100)

0 commit comments

Comments
 (0)