Audio File wont play
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/voice_client.py:172> exception=gaierror(-2, >'Name or service not known')>
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site->packages/discord/voice_client.py", 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?
Its all in the Docs.
First import replit and make sure to upload the sound file as .mp3 or .wav . Type this code:
from replit import audio import time audio.play_file("download.mp3") time.sleep(10)
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