Skip to content
Sign upLog in
← Back to Community
Pygame Audio Issues
Profile icon
LoganHolmes

How do you do audio in a pygame repl. when I do "pygame.mixer.init()", I always get the error "no available audio devices". Is this just that repl can't do audio or is it something in the code?

Voters
Profile icon
NasirAl
Profile icon
ColinWilliams1
Profile icon
AidenWhitehead
Profile icon
HuangJunye
Profile icon
ETHANSIAO
Profile icon
shuhua
Profile icon
LoganHolmes
Comments
hotnewtop
Profile icon
ETHANSIAO

Hi, I've also been having this issue, but I've learned about the answer after a bit of research. Apparently, it is unfortunately not possible to play audio in repl.it, as "repl.it runs on another computer somewhere, so the audio cannot be heard."

Hope this helps!

Profile icon
NigelIsCoding

that is after import pygame

Profile icon
NigelIsCoding

pygame.mixer.music.load('foo.mp3')
pygame.mixer.music.play(0)