Skip to content

Commit

Permalink
src: Update test_record.py.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Jan 15, 2024
1 parent 0988fe0 commit 5f15a0f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
"00000"
)

RECORDING_RATE = 7812
RECORDING_SECONDS = 5
RECORDING_SIZE = RECORDING_RATE * RECORDING_SECONDS

my_recording = audio.AudioFrame(RECORDING_SIZE)
my_recording = audio.AudioFrame(5000)

while True:
if button_a.is_pressed():
microphone.record_into(my_recording, rate=RECORDING_RATE, wait=False)
microphone.record_into(my_recording, wait=False)
display.show([mouth_open, mouth_closed], loop=True, wait=False, delay=150)
while button_a.is_pressed() and microphone.is_recording():
sleep(50)
Expand All @@ -51,7 +47,7 @@
level *= 0.95
display.show(play * min(1, level / 100))
x = accelerometer.get_x()
audio.set_rate(max(2250, scale(x, (-1000, 1000), (2250, 13374))))
my_recording.set_rate(max(2250, scale(x, (-1000, 1000), (2250, 13374))))
sleep(5)
display.clear()
sleep(100)

0 comments on commit 5f15a0f

Please sign in to comment.