Ask coding questions

← Back to all posts
Pygame Audio Issues
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
NasirAl
ColinWilliams1
AidenWhitehead
HuangJunye
ETHANSIAO
shuhua
LoganHolmes
Comments
hotnewtop
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!

duck132912

that is after import pygame

duck132912

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