Ask coding questions

← Back to all posts
Pygame Audio Issues
LoganHolmes (5)

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?

Comments
hotnewtop
ETHANSIAO (39)

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!

duck132912 (196)

that is after import pygame

duck132912 (196)

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