Skip to content

Commit

Permalink
src: Use was_pressed in 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 Sep 9, 2024
1 parent 3639146 commit 180be6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
my_track = None

while True:
if button_a.is_pressed():
if button_a.was_pressed():
my_track = 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():
Expand All @@ -37,7 +37,7 @@
sleep(50)
display.clear()
my_track *= 2 # amplify volume
if button_b.is_pressed() and my_track:
if button_b.was_pressed() and my_track:
audio.play(my_track, wait=False)
level = 0
while audio.is_playing():
Expand Down

0 comments on commit 180be6f

Please sign in to comment.