Ask coding questions

← Back to all posts
Play sound in replit
h
QuantumCodes

the playsound package doesnt work. Is there any way to play a sound on python replit? I want to play an online sound (ie) not downloaded

Voters
QuantumCodes
Comments
hotnewtop
xfinnbar

You can using the replit package, but I recommend making it a website for a better user experience.

QuantumCodes

@xfinnbar example?

xfinnbar

@QuantumCodes

Audio on replit is buggy, so like I said you should probably make a website instead.

QuantumCodes

@xfinnbar but i dont know js or css. Only html

xfinnbar

@QuantumCodes Learn them?????? They're among the most useful coding skills to have.

QuantumCodes

@xfinnbar ok, nvm... i did. But it seems i cannot play a file through url... (i didnt download. Trying to play online)

Coder100

the file must be on your local replit project. @QuantumCodes

QuantumCodes

@Coder100 no way by url?

Coder100

nope
you can just install the mp3 file from the URL @QuantumCodes

QuantumCodes

@Coder100 can we do it while user is running code? Can u give an example? And can we delete it using code?

QuantumCodes

@Coder100 i was using a dictionary api... that also gives pronounciation of the word. I wanted to play that

Coder100

you can use the requests module to download it through the dictionary API if there is one. Otherwise, no luck, maybe you could make it generate an mp3 instead of using dictionary. @QuantumCodes

Carnage498

tru @xfinnbar without CSS or JS, HTML is pretty basic and boring. No style.

QuantumCodes

@Coder100 so i did:

Now? Is this even correct? How do i play this?