Recherche avancée

Médias (0)

Mot : - Tags -/publication

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

Autres articles (54)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (6482)

  • Revision 3475 : Afficher le nombre de téléchargements si disponible

    27 mai 2010, par kent1 — Log

    Afficher le nombre de téléchargements si disponible

  • Revision 6906 : On répare le formulaire de pagination (on limite à 10 le nombre de ...

    20 août 2012, par kent1 — Log

    On répare le formulaire de pagination (on limite à 10 le nombre de sélections possibles)

  • Doubts in the development of a music bot for discord, using DSharpPlus and ffmpeg

    21 avril 2018, par Vralago

    I have been making a bot for Discord, and recently I thought about adding the music system. Well I even understand how it works but also have some things that I’m not understanding how I should do it (I’m using the DiscordSharpPlus api), for example putting the music on pause (bearing in mind that ffmpeg continues to read the music).

    So I wanted to know if anyone can explain me or tell me how I should do it or how it works, given that it is my first time using ffmpeg and I do not know all the functions of the program.

    If it is necessary, there is the code where the ffmpeg is and the sending of data to the discord.

    public static async Task AddMusicFromYoutube(VoiceNextConnection vnc, CommandContext ctx, string url)
    {
       string fileName = "";

       if (url.ToLower().Contains("youtube.com"))
       {
           fileName = await DownloadFromYouTube(url);
           if (fileName == string.Empty) return;

           await ctx.RespondAsync($"Playing for **Youtube** -> `{url}`");
           await vnc.SendSpeakingAsync(true);

           var ffmpeg_pro = new ProcessStartInfo
           {
               FileName = "Libs/ffmpeg",
               Arguments = $@"-xerror -i ""{fileName}.mp3"" -ac 2 -f s16le -ar 48000 pipe:1",
               RedirectStandardOutput = true,
               UseShellExecute = false
           };
           var ffmpeg = Process.Start(ffmpeg_pro);

           Stream ffout = ffmpeg.StandardOutput.BaseStream;

           using (var ms = new MemoryStream())
           {
               await ffout.CopyToAsync(ms);
               ms.Position = 0;

               var buff = new byte[3840];
               var br = 0;
               while ((br = ms.Read(buff, 0, buff.Length)) > 0)
               {
                   if (br < buff.Length)
                       for (var i = br; i < buff.Length; i++)
                           buff[i] = 0;

                   await vnc.SendAsync(buff, 20); // Send PCM date for discord

                   //tentativa de parar a musica
                   if (Program.IsPuased)
                   {
                       while (Program.IsPuased)
                       {
                       }
                   }
               }

               ms.Close();
           }
           await vnc.SendSpeakingAsync(false);
       }
       else
       {
           await ctx.RespondAsync($"{ctx.Member.Mention}, por agora só aceito link's do Youtube!");
           return;
       }
    }