-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hi there!
For the "BouncyBall" game I wanted to add some sound effects. I found some nice WAV files that I wanted to use, which sounded fine on my PC. On the badge they sounded crap. I then tried to convert these with sox ( sox input.wav output.mp3
), and these files sound fine.
To reproduce, use the attached sounderror
app (python file with MP3 and WAV), and use the joystick to play either the MP3 or WAV version of the sound.
Zip with code and audio files
Code
import mch22
import buttons
#import display
import audio
left_pressed = False
right_pressed = False
def left(p):
print("left!")
if p:
global left_pressed
left_pressed = True
def right(p):
if p:
global right_pressed
right_pressed = True
def main():
global left_pressed
global right_pressed
while True:
if left_pressed:
audio.play('/apps/python/sounderror/sfx_footsteps.mp3', volume=20);
left_pressed = False
if right_pressed:
audio.play('/apps/python/sounderror/sfx_footsteps.wav', volume=20);
right_pressed = False
buttons.attach(buttons.BTN_LEFT, left)
buttons.attach(buttons.BTN_RIGHT, right)
main()
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🆕 New