Skip to content
Sign upLog in
← Back to Community

I tried to import playsound and play an audio file but its showing and error

Profile icon
JeromandJaison

The code I put was

import playsound playsound ("audio.wav")

but its telling that there is no module name gi. Is there a way to solve this?

Voters
Profile icon
DanielMitchell0
Profile icon
ch1ck3n
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

Solution

playsound doesn't work in repl.it. The only sound system is repl audio. Here's a tutorial on how to use it.

https://docs.repl.it/repls/audio

Profile icon
19wintersp

If you're running this on your local computer, gi seems to be a separate library which needs installing. If you're trying to run this on Replit, audio does not currently work as it normally would, and you must use their API.