Wall-E icon indicating copy to clipboard operation
Wall-E copied to clipboard

Song Doesn't Play

Open meinhoonharsh opened this issue 3 years ago • 14 comments

When we give command #play_song song_name or song_link, the audio file gets downloaded but the song didn't play, It show the bot is not connected to voice channel even when it is connected to Voice Channel

meinhoonharsh avatar Apr 10 '21 16:04 meinhoonharsh

Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it:

First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip)

Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is.

Third, locate the command "play_sound" and change this line to the new line:

voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename))

Thats it.

Lilin20 avatar Apr 17 '21 12:04 Lilin20

@meinhoonharsh we need to have the ffmpeg.exe file previously downloaded before execution. Thankyou @Lilin20 for pointing that out! Kindly check if this fixes the issue😄

Kakarot-2000 avatar Apr 17 '21 12:04 Kakarot-2000

Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it:

First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip)

Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is.

Third, locate the command "play_sound" and change this line to the new line:

voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename))

Thats it.

doesnt fix

DawgieModder avatar May 11 '21 18:05 DawgieModder

Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it: First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip) Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is. Third, locate the command "play_sound" and change this line to the new line: voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename)) Thats it.

doesnt fix

Hey! Are you facing the same issue where it says that the bot isn't connected to the voice chat even though it is?

Kakarot-2000 avatar May 12 '21 09:05 Kakarot-2000

Yes I am facing this problem

Sent from my iPhone

On 12 May 2021, at 10:40, Rohan Krishna Ullas @.***> wrote:

 Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it: First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip) Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is. Third, locate the command "play_sound" and change this line to the new line: voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename)) Thats it.

doesnt fix

Hey! Are you facing the same issue where it says that the bot isn't connected to the voice chat even though it is?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

DawgieModder avatar May 12 '21 11:05 DawgieModder

Yes I am facing this problem Sent from my iPhone On 12 May 2021, at 10:40, Rohan Krishna Ullas @.***> wrote:  Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it: First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip) Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is. Third, locate the command "play_sound" and change this line to the new line: voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename)) Thats it. doesnt fix Hey! Are you facing the same issue where it says that the bot isn't connected to the voice chat even though it is? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hey! Could you show the code you're working on?

Kakarot-2000 avatar May 18 '21 02:05 Kakarot-2000

Same code you gave me

Sent from my iPhone

On 18 May 2021, at 03:44, Rohan Krishna Ullas @.***> wrote:

 Yes I am facing this problem … Sent from my iPhone On 12 May 2021, at 10:40, Rohan Krishna Ullas @.***> wrote:  Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it: First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip) Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is. Third, locate the command "play_sound" and change this line to the new line: voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename)) Thats it. doesnt fix Hey! Are you facing the same issue where it says that the bot isn't connected to the voice chat even though it is? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hey! Could you show the code you're working on?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

DawgieModder avatar May 18 '21 11:05 DawgieModder

Yes I am facing this problem Sent from my iPhone On 12 May 2021, at 10:40, Rohan Krishna Ullas @.***> wrote:  Hi, i am not the developer of this thing BUT i might be able to help you. I found the problem and solved it: First, download FFmpeg https://github.com/BtbN/FFmpeg-Builds/releases (ffmpeg-N-101958-g39eafd0b2e-win64-gpl.zip) Second, inside the FFmpeg folder you find BIN and DOC. Paste the BIN folder into the folder where your current bot script is. Third, locate the command "play_sound" and change this line to the new line: voice_channel.play(discord.FFmpegPCMAudio(executable="PATH TO YOUR FFMPEG.EXE", source=filename)) Thats it. doesnt fix Hey! Are you facing the same issue where it says that the bot isn't connected to the voice chat even though it is? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Hey! Could you show the code you're working on?

@client.command() async def Play(ctx, url): voice_client = bot.voice_clients[1]

ytdl = youtube_dl.YoutubeDL(YTDL_OPTS)
info = ytdl.extract_info(url, download=True)

asrc = discord.FFmpegOpusAudio(info['formats'][0]['url'], before_options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5")

voice_client.play(asrc)

DawgieModder avatar May 18 '21 19:05 DawgieModder

Hey @DawgieModder, I think this code is different from the one I have written. Did you try the code for the method play() I wrote and face any issue?

Kakarot-2000 avatar May 19 '21 16:05 Kakarot-2000

Oh, can you put the code please

Sent from my iPhone

On 19 May 2021, at 17:58, Rohan Krishna Ullas @.***> wrote:

 Hey @DawgieModder, I think this code is different from the one I have written. Did you try the code for the method play() I wrote and face any issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

DawgieModder avatar May 19 '21 17:05 DawgieModder

Hey @DawgieModder , the code is available in app2.py from this repository.

Kakarot-2000 avatar May 19 '21 17:05 Kakarot-2000

Ok lemme get back to you if work or not

Sent from my iPhone

On 19 May 2021, at 18:40, Rohan Krishna Ullas @.***> wrote:

 Hey @DawgieModder , the code is available in app2.py from this repository.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

DawgieModder avatar May 19 '21 18:05 DawgieModder

@DawgieModder did it work ?

RVZWN avatar Aug 18 '21 16:08 RVZWN

The code worked but showed NOT AUTHORISED so I have changed the author.name in code @bot.command(name='play_song', help='To play song') async def play(ctx,url):

if not ctx.message.author.name=="username" :
     await ctx.send('NOT AUTHORISED!')
     return
try :

then it's again showing "not connected to voice channel"

Manoj-Routhu avatar Nov 24 '22 19:11 Manoj-Routhu