Skip to content

Commit 196398d

Browse files
committed
update code for scooter soundboard
update code for scooter soundboard
1 parent dbfe115 commit 196398d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Soundboard_Scooter_Bike/code.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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

66
import time
77
import board
@@ -15,9 +15,10 @@
1515

1616
# list of (samples to play, mixer gain level)
1717
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
2122
)
2223

2324
# pins used by keyboard
@@ -47,6 +48,7 @@ def handle_mixer(num, pressed):
4748

4849

4950
while 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):

Soundboard_Scooter_Bike/wav/idle.wav

172 KB
Binary file not shown.

0 commit comments

Comments
 (0)