Ask coding questions

← Back to all posts
Can't get music running on Pygame
Rishan001 (43)

See my repl, I want to add some music to it (for testing we're trying the TETRIS theme tune, but we (@220208 and I) get the following error:
pygame.error: ALSA: Couldn't open audio device: No such file or directory

Run the REPL to see the log. I think it's because we have to set up the speaker drivers, and that's all in the REPL.IT headquarters. How do we fix this?

Comments
hotnewtop
Coder100 (16760)

you can't play music on replit.
You must use the replit package:
https://docs.repl.it/repls/audio

Rishan001 (43)

@Coder100 Ah, it works now! Thanks for the reply! I never knew there was a replit package!

OldWizard209 (1104)

@220208 @Rishan001 I think try doing this in a Pygame Repl rather than a normal repl...:

If that doesn't work and your code is correct, then replit is having a few problems, report it here:
https://replit.com/bugs/
Note: If I answered your question in the other post, don't mark this as correct @Rishan001

Rishan001 (43)

@OldWizard209 We’re using a Pygame REPL, I’ll just report it now

220208 (6)

We would appreciate any help!