Skip to content
← Back to Community
How to play an audio file in python?
Profile icon
HarperframeInc

I'm not sure how to play audio files.
I've tried many stack-overflow answers, but they don't work.
Any Solutions?

Answered by amasad [earned 5 cycles]
View Answer
Voters
Profile icon
TheBigBoi429
Profile icon
bobertoroberto
Profile icon
DaddyisBack123
Profile icon
yanovsky
Profile icon
ShauryanK
Profile icon
isrsanchez
Profile icon
benjammmmmmmm
Profile icon
if-anyone-kan
Profile icon
JAYDENCHO1
Profile icon
HenryViechnicki
Comments
hotnewtop
Profile icon
amasad

Hey we have an API for sound now. It's in beta be sure to be an explorer to try it https://docs.repl.it/repls/audio

Profile icon
SeamusDonahue

still doesn't seem to function, at least for me (and yes I am an explorer its some other problem)

Profile icon
HarperframeInc

@SeamusDonahue Make an issue here (Suggesting your using python)

Profile icon
SeamusDonahue

posted issue there. thanks! @HarperframeInc

Profile icon
mat1

Unfortunately, it is currently impossible to play audio files in Repl.it because of the way it works.
Please upvote this comment if it was helpful or useful in any way

Profile icon
ash15khng

In repl.it it isn't possible, as repl.it runs on another computer somewhere, so the audio cannot be heard.

Profile icon
HappyFakeboulde

Repl.it currently does not support audio.
If you want me to help you with something outside of repl.it, you'll need to tell me the file format and the OS you're using.

Profile icon
GitOverHere

print ("\a")

Profile icon
HarperframeInc

@GitOverHere That's a beep. I'm not sure I could use this solution. Mat has already answered this question, but thank you for your help!

Profile icon
GitOverHere

@HarperframeInc I think if you put a bunch of beeps together, they make a sound. Theoretically, you could load an audio file into python to create a function that converts the audio data into beeps by calling print("\a") depending on the frequency played in the audio file. I think this could work, but I'm not sure because I have not tried it.

Profile icon
amena0
Profile icon
LionelPOUJET

Any update of this ?
Thanks a lot for your feedback