File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: 2022 John Park for Adafruit Industries
22# SPDX-License-Identifier: MIT
33
4- # put samples in "/wav" folder
4+ # Convert files to appropriate WAV format (mono, 22050 Hz, 16-bit signed)
55
66import time
77import board
1515
1616# list of (samples to play, mixer gain level)
1717wav_files = (
18- ('wav/airhorn.wav' , 1.0 ),
19- ('wav/bike-horn.wav' , 1.0 ),
20- ('wav/chime.wav' , 1.0 )
18+ ('wav/airhorn.wav' , 1.0 ), #Honk sound 1
19+ ('wav/bike-horn.wav' , 1.0 ), #Honk around 2
20+ ('wav/chime.wav' , 1.0 ), #Honk sound 3
21+ ('wav/idle.wav' , 1.0 ) #Looping Engine Sound Effect
2122)
2223
2324# pins used by keyboard
@@ -47,6 +48,7 @@ def handle_mixer(num, pressed):
4748
4849
4950while True :
51+ mixer .voice [3 ].level = 1 #Looping Engine Sound Effect
5052 event = km .events .get ()
5153 if event :
5254 if event .key_number < len (wav_files ):
You can’t perform that action at this time.
0 commit comments