Created
March 29, 2022 11:56
-
-
Save HuangJiaLian/f483b8baddacc40772df265701be3d4a to your computer and use it in GitHub Desktop.
Play strong and weak beats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import simpleaudio, time | |
strong_beat = simpleaudio.WaveObject.from_wave_file('strong_beat.wav') | |
weak_beat = simpleaudio.WaveObject.from_wave_file('weak_beat.wav') | |
count = 0 | |
while True: | |
count = count + 1 | |
if count == 1: | |
strong_beat.play() | |
else: | |
weak_beat.play() | |
if count == 4: | |
count = 0 | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment