Last active
September 23, 2022 17:52
-
-
Save HuangJiaLian/d83f13db1f26fec3c876d3e99952147d to your computer and use it in GitHub Desktop.
Play click sound
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') | |
while True: | |
strong_beat.play() | |
time.sleep(0.5) |
@Zigomar7 Hi, sorry to make you confused. Here, the audio file strong_beat.wav
should be placed in the same folder as the python script 1_play_beats.py
. You can download it from here: https://github.com/HuangJiaLian/HuanBu_Metronome/tree/main/src .
I had a hard time finding how to download.
After trying a number of ways from that page and the main page I ended up in the project page where I found the Code tab with Download ZIP link !
thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I get : "FileNotFoundError: [Errno 2] No such file or directory: 'strong_beat.wav'" on line 2
I searched my C drive for 'strong_beat.wav', seems it should come with the package, but its not with the samples in ...\AppData\Local\Packages\Python...\site-packages\simpleaudio\test_audio.
What happened ?
I also tried with the name of one of the wav file (without path) from test_audio folder and it wasn't found either (It worked with a full path) !
A questions pops to mind : what is the default directory for simpleaudio.WaveObject.from_wave_file ?
Where will I find this type of information ?
I'm new to Python ...
Thanks