
Recherche avancée
Autres articles (92)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Liste des distributions compatibles
26 avril 2011, parLe tableau ci-dessous correspond à la liste des distributions Linux compatible avec le script d’installation automatique de MediaSPIP. Nom de la distributionNom de la versionNuméro de version Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
Si vous souhaitez nous aider à améliorer cette liste, vous pouvez nous fournir un accès à une machine dont la distribution n’est pas citée ci-dessus ou nous envoyer le (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (6516)
-
Discord.py bot joins voice channel but when using voicechannel.play i get error:Command raised an exception : ClientException : Not connected to voice
25 mai 2023, par AudibleDruidSo i've managed to get my discord bot to join a voice channel but when i use the play command it gives me an error that its not conencted to voice
Command raised an exception: ClientException: Not connected to voice.


Here is my code :


import discord
import random
import glob
from discord.ext import commands

##discord intents 
intents = discord.Intents()
intents.members = True
intents.messages = True
intents.guilds = True
intents.voice_states = True



connect the bot to a voice channel :



##called when user wants bot to join voice channel
@bot.command(name ='join', help = 'Make the bot join a voice channel')
async def join(context):
 
 botVoice = context.message.guild.voice_client
 if context.guild.voice_client:
 botvoicechannel = context.message.guild.voice_client.channel
 else:
 botvoicechannel = None
 authorVoice = context.author.voice
 if context.author.voice:
 authorvoicechannel = context.author.voice.channel
 else:
 authorvoicechannel = None
 
 ##await context.reply('bot voice channel: {}\n\nbot voice:\n{}\n\nauthor voice channel: {}\n\nauthor voice voice:\n{}\n\n'.format(botvoicechannel, botVoice, authorvoicechannel, authorVoice))
 
 if not authorVoice and not botVoice:
 await context.reply('Connect to a voice channel first.')
 return
 elif authorVoice and not botVoice:
 await context.reply('Connecting to {}'.format(authorvoicechannel))
 await authorvoicechannel.connect()
 return
 elif not authorVoice and botVoice:
 await context.reply("You aren't in a channel, I'm in {}".format(botvoicechannel))
 return
 elif authorVoice and botVoice:
 if (botvoicechannel == authorvoicechannel):
 await context.reply("I'm already in here.")
 return
 else:
 await context.reply('Moving to you!')
 await botVoice.move_to(authorvoicechannel)
 return
 return



and have it play a url :


@bot.command(name ='play', help = 'Make the bot play a url')
async def play(context, url):
 botVoice = context.message.guild.voice_client
 audioSource = discord.FFmpegPCMAudio(url, executable="ffmpeg")
 botVoice.play(audioSource, after = None)



the code works and the bot joins the voice channel. i see it in the voice channel with me, however i get an error when it gets to
botVoice.play(audioSource, after = None)


the error message is :

error: Command raised an exception: ClientException: Not connected to voice.


i changed
botVoice = context.message.guild.voice_client
frombotVoice = context.guild.voice_client
but that didnt seem to change anything. not sure what to try next. It seems like it wants to play the url the bot just doesnt realize its in the voice channel with me.

maybe a related error. if i kill my python script the bot remains in the channel even though its not running. then when i start it up and do the !join command it says its joining even though its already in the channel with me. its weird because on the join command it checks to see if its already in a voice channel so it should know that its in there with me. idk what to try next. thanks for any suggestions. i only posted relevant code. let me know if you think im missing something else.


thanks for the help


-
Discord.NET 1.0.2 sending voice to voice channel not working
17 octobre 2018, par Sahar ArielI did everything like the Discord.Net Documentation guide on voice -
https://discord.foxbot.me/latest/guides/voice/sending-voice.html
and it didn’t work the bot just joined the voice channel but it dont make any sound.
and i have ffmpeg installed in PATH and ffmpeg.exe in my bot Directory along with opus.dll and libsodium.dll so i dont know what is the problem...public class gil : ModuleBase<socketcommandcontext>
{
[Command("join")]
public async Task JoinChannel(IVoiceChannel channel = null)
{
// Get the audio channel
channel = channel ?? (Context.Message.Author as IGuildUser)?.VoiceChannel;
if (channel == null) { await Context.Message.Channel.SendMessageAsync("User must be in a voice channel, or a voice channel must be passed as an argument."); return; }
// For the next step with transmitting audio, you would want to pass this Audio Client in to a service.
var audioClient = await channel.ConnectAsync();
await SendAsync(audioClient,"audio/hello.mp3");
}
private Process CreateStream(string path)
{
return Process.Start(new ProcessStartInfo
{
FileName = "ffmpeg.exe",
Arguments = $"-hide_banner -loglevel panic -i \"{path}\" -ac 2 -f s16le -ar 48000 pipe:1",
UseShellExecute = false,
RedirectStandardOutput = true,
});
}
private async Task SendAsync(IAudioClient client, string path)
{
// Create FFmpeg using the previous example
using (var ffmpeg = CreateStream(path))
using (var output = ffmpeg.StandardOutput.BaseStream)
using (var discord = client.CreatePCMStream(AudioApplication.Mixed))
{
try { await output.CopyToAsync(discord); }
finally { await discord.FlushAsync(); }
}
}
}
</socketcommandcontext>please help
-
m4a/mp3 files to wav for Bing Speech API
17 décembre 2018, par WaqasBing Speech API only accepts wav files so I have been trying to convert m4a (Skype) and mp3 (Facebook) audio files I am getting in my chatbot to wav format. I am using fluent-ffmpeg in node.js.
For now, I am downloading the audio file, converting it to wav and returning the piped output for use ahead.
if (attachment.contentType === 'audio/x-m4a') {
request.get(attachment.contentUrl).pipe(fs.createWriteStream('file.m4a'));
var command = ffmpeg('file.m4a')
.toFormat('wav')
.on('error', function (err) {
console.log('An error occurred: ' + err.message);
})
.on('progress', function (progress) {
// console.log(JSON.stringify(progress));
console.log('Processing: ' + progress.targetSize + ' KB converted');
})
.on('end', function () {
console.log('Processing finished !');
});
return command.pipe();
}Right now, the conversion works when I send the m4a file through the botframework-emulator on my pc. But when I specify my pc as the endpoint (through ngrok) and try to send the m4a file from the chat test at the bot framework developer end, ffmpeg returns an error :
An error occurred: ffmpeg exited with code 1: file.m4a: Invalid data found when processing input
But when I play the downloaded m4a file, it plays alright.
The content URL is https in the second case if that matters.
Kindly help me with two things :
- Downloading, Converting and Returning without storing anything on my end
- Downloading/Accessing m4a/mp3 files properly
I am new to streams, pipes and ffmpeg and all the above code is after googling.