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 1
1
# SPDX-FileCopyrightText: 2022 John Park for Adafruit Industries
2
2
# SPDX-License-Identifier: MIT
3
3
4
- # put samples in "/wav" folder
4
+ # Convert files to appropriate WAV format (mono, 22050 Hz, 16-bit signed)
5
5
6
6
import time
7
7
import board
15
15
16
16
# list of (samples to play, mixer gain level)
17
17
wav_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
21
22
)
22
23
23
24
# pins used by keyboard
@@ -47,6 +48,7 @@ def handle_mixer(num, pressed):
47
48
48
49
49
50
while True :
51
+ mixer .voice [3 ].level = 1 #Looping Engine Sound Effect
50
52
event = km .events .get ()
51
53
if event :
52
54
if event .key_number < len (wav_files ):
You can’t perform that action at this time.
0 commit comments