Recherche avancée

Médias (1)

Mot : - Tags -/bug

Autres articles (74)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (3803)

  • Unknown issue with Discord.js and ytdl, completely skips playing audio

    21 novembre 2017, par Gman0064

    One of the commands I have for my Discord bot is to play a predefined music clip in the current user’s voice channel. The bot can connect, but rather than playing the song, it instantaneously leaves. I’ve tried using both connection.playStream as well as connection.playFile, and both seem to return the same (lack of) output. Am I missing some sort of dependency or is my code just written incorrectly ? Any help would be greatly appreciated !

    const Discord = require('discord.js');
    const ytdl = require('ytdl-core');
    const client = new Discord.Client();
    const streamOptions = { seek: 0, volume: 1};

    client.on('ready', () => {
     console.log('Login Success');
    });

    client.on('message', message => {
     if (message.content === '$vaporwave') {
       if (!message.guild) return;
       if(message.member.voiceChannel) {
         message.member.voiceChannel.join().then(connection => {
           console.log("joined channel");
           //const stream = ytdl('https://www.youtube.com/watch?v=cU8HrO7XuiE', { filter : 'audioonly' });
           const dispatcher = connection.playFile('./mcp420.mp3');
           //const dispatcher = connection.playStream(stream, streamOptions);
           dispatcher.on("end", end => {
             console.log("left channel");
             message.member.voiceChannel.leave();
           });
         }).catch(err => console.log(err));
       }
     }
    });
    • NPM v4.6.1
    • Node.js v8.9.1
    • FFMPEG v3.2.8-1
  • ffmpeg / avconv error while using a discord bot slash cmd

    30 novembre 2022, par Ema R

    Code

    


    const {
    SlashCommandBuilder,
    PermissionFlagsBits,
    PermissionsBitField,
    EmbedBuilder,
  } = require("discord.js");

    const { generateDependencyReport, AudioPlayerStatus, joinVoiceChannel, createAudioPlayer, createAudioResource  } = require('@discordjs/voice'); 
  const googleTTS = require("google-tts-api");

module.exports = {
  data: new SlashCommandBuilder()
    .setName(`tts`)
    .setDescription(`Fai ripetere al bot un messaggio in un canale vocale`)
    .addStringOption((option) =>
        option
          .setName("messaggio")
          .setDescription("Scrivi il messaggio da far ripetere dal bot in vocale")
          .setRequired(true)
      )
    .addBooleanOption((option) =>
    option
      .setName("rallentatore")
      .setDescription("Vuoi che il messaggio sia mandato a rallentatore?")
      .setRequired(true)
  ),  
  async execute(interaction, client) {

    const testo = interaction.options.getString("messaggio");
    const slow = interaction.options.getBoolean("rallentatore");



     const url = googleTTS.getAudioUrl(testo, {
        lang: "it",
        slow: slow,
        host: 'https://translate.google.com',
      });

      


      const { generateDependencyReport, AudioPlayerStatus, joinVoiceChannel, createAudioPlayer, createAudioResource  } = require('@discordjs/voice');



      const voiceChannelId = interaction.member.voice.channel.id
        const voiceChannel = interaction.member.voice.channel
        const guildId = interaction.guild.id

        
        const player = createAudioPlayer();

    

        const resource = createAudioResource(url);
        player.play(resource);

        
        const connection = joinVoiceChannel({
            channelId: voiceChannelId,
            guildId: guildId,
            adapterCreator: voiceChannel.guild.voiceAdapterCreator,
        });    



        const subscription = connection.subscribe(player);


        if (subscription) {
            setTimeout(() => subscription.unsubscribe(), 30_000);
        }

 
    
  },
};



    


    Error

    


    Error: FFmpeg/avconv not found!&#xA;    at Function.getInfo (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\node_modules\prism-media\src\core\FFmpeg.js:143:11)&#xA;    at Function.create (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\node_modules\prism-media\src\core\FFmpeg.js:156:38)&#xA;    at new FFmpeg (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\node_modules\prism-media\src\core\FFmpeg.js:45:27)&#xA;    at Object.transformer (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\node_modules\@discordjs\voice\dist\index.js:1699:27)&#xA;    at C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\node_modules\@discordjs\voice\dist\index.js:1855:58&#xA;    at Array.map (<anonymous>)&#xA;    at createAudioResource (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\node_modules\@discordjs\voice\dist\index.js:1855:39)&#xA;    at Object.execute (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\src\commands\tools\tts.js:56:26)&#xA;    at Object.execute (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\src\events\client\interactionCreate.js:13:23)&#xA;    at Client.<anonymous> (C:\Users\Casa\OneDrive\Desktop\Discord\eKicks\eKicks Bot v14\src\functions\handlers\handleEvents.js:20:23)&#xA;</anonymous></anonymous>

    &#xA;

    i am making a command to play a message in a voice channel. Once this error was returned from the terminal I installed ffmpeg by creating an environment variable and installed python. I don't understand why it keeps giving this error. below I am attaching a picture of the npm list

    &#xA;

    npm list

    &#xA;

    maybe I also have to install avconv but I don't know how to do it, could you please attach the link ? do i need to add avconv to the environment variables as well ?

    &#xA;

  • Anomalie #3991 : Erreur compression CSS et base64

    29 août 2017, par tcharlss (*´_ゝ`)

    La ligne fautive se trouve ici : https://zone.spip.org/trac/spip-zone/browser/_core_/plugins/compresseur/inc/compresseur_minifier.php#L100

    // zero est zero, quelle que soit l’unite (sauf pour % car casse les @keyframes cf https://core.spip.net/issues/3128)
    $contenu = preg_replace("/([^0-9.]0)(em|px|pt)/ms", "$1", $contenu) ;
    

    Ça cherche le nombre zéro précédé de n’importe quel caractère (autre qu’un chiffre) ou d’un point.
    Du coup ça peut matcher avec les data URIs :

    @font-facefont-family :’spip’ ;src:url("data:application/font-woff ;base64,abc0pxyz") ;
    

    Pour éviter ce souci, on pourrait préciser exactement quels caractères peuvent précéder le zéro pour considérer qu’il s’agit d’une unité. On peut avoir :

    1) deux points

    font-size:0px ;
    

    2) un ou plusieurs espaces

    font-size : 0px ;
    font-size : calc(10px + 0px) ;
    

    3) une parenthèse dans le cas de calc()

    font-size : calc(0px) ;
    

    4) Autres unités

    À noter qu’il y a aussi pas mal d’autres unités qui ne sont pas prises en compte dans la regex actuelle : https://www.w3schools.com/cssref/css_units.asp

    rem ex pc
    vh vw vmin vmax 
    cm mm in
    ch 
    

    Ce qui donne au final la regex suivante, qui laisse mes data URIs tranquilles :

    $contenu = preg_replace("/((?: :|\s+|\()0)(em|px|pt|rem|ex|pc|vh|vw|vmin|vmax|cm|mm|in|ch)/ms", "$1", $contenu) ;