Ask coding questions

← Back to all posts
Audio File wont play
lazymunch (1)

I've got multiple comments around line 34. That spot is where I've attempted MULTIPLE methods to get this audio file to play.

The error is the same every time.

Task exception was never retrieved
future: <Task finished name='Task-14' coro=>><VoiceClient._create_socket() done, defined at >/opt/virtualenvs/python3/lib/python3.8/site->packages/discord/> exception=gaierror(-2, >'Name or service not known')>
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site->packages/discord/", line 191, in _create_socket
self.endpoint_ip = socket.gethostbyname(self.endpoint)
socket.gaierror: [Errno -2] Name or service not known

Can you play audio?

OldWizard209 (1702)

Its all in the Docs.

First import replit and make sure to upload the sound file as .mp3 or .wav . Type this code:

The time.sleep in the end is there because once the file is executed, repl abruptly stops. So it is there so that the audio can run.

I copied this answer from another question i answered

lazymunch (1)

@OldWizard209 I solved it, that wasn't it. was the wrong version.