Recherche avancée

Médias (0)

Mot : - Tags -/organisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (64)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (10541)

  • music bot stopping music entirely instead of skipping one song discord.py

    26 septembre 2018, par Y4h L

    When i use my skip command, my program stops playing music, instead of skipping a song.
    Here’s the code :

    queues = {}
    players = {}
    opts = {
               'default_search': 'auto',
               'quiet': True,
           }
    voice_states = {}

    class voice:
       def __init__(self, client):
           self.client = client

       @commands.command(pass_context=True)
       async def skip(self, ctx):
           id = ctx.message.server.id
           players[id].stop()

       @commands.command(
           pass_context=True
       )
       async def play(self, ctx, url):
           server = ctx.message.server
           channel = ctx.message.author.voice.voice_channel
           try:
               await self.client.join_voice_channel(channel)
           except:
               print(" ")
           if server.id not in players or players[server.id].is_done():
               server = ctx.message.server
               voice_client = self.client.voice_client_in(server)
               player = await voice_client.create_ytdl_player(url, after=lambda: queue(server.id), ytdl_options=opts)
               players[server.id] = player
               await self.client.say('Now Playing ' )
               player.start()
           else:
               server = ctx.message.server
               voice_client = self.client.voice_client_in(server)
               player = await voice_client.create_ytdl_player(url, after=lambda: queue(server.id),  ytdl_options=opts)

               if server.id in queues:
                   queues[server.id].append(player)
               else:
                   queues[server.id] = [player]
               await self.client.say('Now Playing ' )
               await self.client.say('Video queued.')

       def queue(self, id):
           if queues[id] != []:
               player = queues[id].pop(0)
               players[id] = player
               player.start()

    def setup(client):
       client.add_cog(voice(client))

    i receive no error codes,
    just no queue.
    Fixes to my code or own solutions are appreciated.
    Sorry, for long code, but you need all the context

  • Need Help Making Java Script Discord Music Bot

    2 février 2017, par Gambino

    I have tried to use this code to make a discord music bot but i am getting error telling me i need ffmpeg, but how would I implement it into this code ?

    index.js file

    const Discord = require('discord.js');
    const bot = new Discord.Client();
    const config = require("./config.json");
    const ytdl = require('ytdl-core');

    var youtube = require('./youtube.js');


    var ytAudioQueue = [];
    var dispatcher = null;

    bot.on('message', function(message) {
       var messageParts = message.content.split(' ');
       var command = messageParts[0].toLowerCase();
       var parameters = messageParts.splice(1, messageParts.length);

       switch (command) {

           case "-join" :
           message.reply("Attempting to join channel " + parameters[0]);
           JoinCommand(parameters[0], message);
           break;
       
           case "-play" :
           PlayCommand(parameters.join(" "), message);
           break;

           case "-playqueue":
           PlayQueueCommand(message);
           break;
       }
    });


       function PlayCommand(searchTerm) {
           if(bot.voiceConnections.array().length == 0) {
               var defaultVoiceChannel = bot.channels.find(val => val.type === 'voice').name;
               JoinCommand(defaultVoiceChannel);
           }
           youtube.search(searchTerm, QueueYtAudioStream);
       }

       function PlayQueueCommand(message) {
           var queueString = "";

           for(var x = 0; x < ytAudioQueue.length; x++) {
               queueString += ytAudioQueue[x].videoName + ", ";
           }
           queueString = queueString.substring(0, queueString.length - 2);
           message.reply(queueString);
       }

       function JoinCommand(ChannelName) {
           var voiceChannel = GetChannelByName(ChannelName);

           if (voiceChannel) {
               voiceChannel.join();
               console.log("Joined " + voiceChannel.name);
           }
           
           return voiceChannel;
           
       }

       /* Helper Methods */

       function GetChannelByName(name) {
           var channel = bot.channels.find(val => val.name === name);
           return channel;
       }

     

       function QueueYtAudioStream(videoId, videoName) {
           var streamUrl = youtube.watchVideoUrl + videoId;

           if (!ytAudioQueue.length) {
               ytAudioQueue.push(
                   {
                       'streamUrl' : streamUrl,
                       'videoName' : videoName
                   }
               );
               console.log('Queued audio ' + videoName);
               PlayStream(ytAudioQueue[0].streamUrl);
           }
           else {
               ytAudioQueue.push(
                   {
                       'streamUrl' : streamUrl,
                       'videoName' : videoName
                   }
               );
           }
           console.log("Queued audio " + videoName);
       }

       function PlayStream(streamUrl) {
           const streamOptions = {seek: 0, volume: 1};

           if (streamUrl) {
               const stream = ytdl(streamUrl, {filter: 'audioonly'});

               if (dispatcher == null) {
                   var voiceConnection = bot.voiceConnections.first();

                   if(voiceConnection) {
                       console.log("Now Playing " + ytAudioQueue[0].videoname);
                       dispatcher = bot.voiceConnections.first().playStream(stream, streamOptions);

                       dispatcher.on('end', () => {
                           dispatcher = null;
                           PlayNextStreamInQueue();
                       });

                       dispatcher.on('error', (err) => {
                           console.log(err);
                       });
                   }
               } else {
                   dispatcher = bot.voiceConnections.first().playStream(stream, streamOptions);
               }
               
           }
       }

       function PlayNextStreamInQueue() {
           ytAudioQueue.splice(0, 1);

           if (ytAudioQueue.length != 0) {
               console.log("now Playing " + ytAudioQueue[0].videoName);
               PlayStream(ytAudioQueue[0].streamUrl);
           }
       }


    bot.login(config.token);

    youtube.js file

    var request = require('superagent');

    const API_KEY = "My API KEY";
    const WATCH_VIDEO_URL = "https://www.youtube.com/watch?v=";

    exports.watchVideoUrl = WATCH_VIDEO_URL;

    exports.search = function search(searchKeywords, callback) {
     var requestUrl = 'https://www.googleapis.com/youtube/v3/search' + '?part=snippet&q=' + escape(searchKeywords) + '&key=' + API_KEY;

     request(requestUrl, (error, response) => {
       if (!error && response.statusCode == 200) {

         var body = response.body;
         if (body.items.length == 0) {
           console.log("I Could Not Find Anything!");
           return;
         }
         for (var item of body.items) {
           if (item.id.kind == 'youtube#video') {
             callback(item.id.videoId, item.snippet.title);
             return;
           }
         }
       } else {
         console.log("Unexpected error!");
         return;
       }
     });

     return;

    };

    Error I am getting when I try to run code :

    Joined General

    C :\Discord Bot\node_modules\discord.js\src\client\voice\pcm\FfmpegConverterEngine.

    js:80

    throw new Error(

    ^

    Error : FFMPEG was not found on your system, so audio cannot be played. Please make
    sure FFMPEG is installed and in your PATH.

  • Discord music Bot Python starts ffmpeg, green light appears around bot but no audio plays [closed]

    27 avril 2023, par QuestionHaver99

    I've tried using FFmpegOpusAudio and FFMPEGPCMaudio instead, but it gives the same issue. FFMPEG starts and the green light of the bot in the channel shows, but no audio plays, and then the bot exits the channel when the song should be over and FFMPEG terminates. I've tried streaming the audio and playing from a local file, and the same issue.

    


    and just as a quick checklist of confirmed not the issues : the volume is fine and the permissions are fine and ffmpeg is in environment variables and set up correctly.

    


    any advice would be greatly appreciated