Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (55)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • 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.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (10027)

  • Bot connects to chat but doesn't play audio - Discord.py Rewrite

    14 mai 2020, par William Anstey

    Here is the command
It passes no errors but still doesn't play any audio

    



    @bot.command(pass_context=True,aliases=["Play,Song"])
async def playSongs(ctx):
    channel = ctx.message.author.voice.channel
    if not channel:
        await ctx.send("You are not connected to a voice channel")
        return
    voice = get(bot.voice_clients, guild=ctx.guild)
    if voice and voice.is_connected():
        await voice.move_to(channel)
    else:
        voice = await channel.connect()
    source = FFmpegPCMAudio('song.m4a')
    player = voice.play(source)


    


  • Some download errors in my discrod musicbot

    24 avril 2021, par takugrano

    I am making my music bot for discord
but i am having some problem with uploading videos

    


     @client.command()
async def play(ctx, url : str):
    song_there=os.path.isfile("song.mp3")
    try:
        if song_there:
            os.remove("song.mp3")
    except PermissionError:
        await   ctx.send("music is playing right now, use !stop command")
        return
    voiceChannel=discord.utils.get(ctx.guild.voice_channels,name='General')
    await voiceChannel.connect()
    voice=discord.utils.get(client.voice_clients,guild=ctx.guild)



    ydl_opts={
        'format':'bestaudio/best',
        'postprocessors':[{
                  'key':'FFmpegExtractAudio',
                  'preferredcodec':'mp3',
                  'preferredquality': '192',
              }],
    }
    with youtube_dl.YoutubeDL(ydl_opts)as ydl:
        ydl.download([url])
    for file in os.listdir("./"):
        if file.endswith(".mp3"):
            os.rename(file,"song.mp3")
    voice.play(discord.FFmpegPCMAudio("song.mp3"))


    


    in my programm I have more code but it is not that important.
After compile i have this :

    


    [youtube] 5RGaoLpBASw: Downloading webpage
[download] Destination: F1 Tokyo Drift-5RGaoLpBASw.m4a
[download] 100% of 1.11MiB in 00:00                  
[ffmpeg] Correcting container in "F1 Tokyo Drift-5RGaoLpBASw.m4a"
    ERROR: 
    Ignoring exception in command play:


    


    and this :

    


    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError


    


    and this :

    


    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: 


    


    and finally this :

    


    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: DownloadError: ERROR: 


    


    but on my discord server nothing but connecting the bot to the channel happens
however, a file with the .m4a extension appears in the programm directory, which I need to play.

    


    how can i fix these errors ?

    


  • Discord slash command music bot stops playing unexpectedly

    29 juillet 2023, par Shelby

    This is a bot I am using to play music and it worked just fine for a while until it didn't. Simply loaded the bot and played for about a minute and quits. From what I see it destroys the entire queue of songs, no matter how many are there. And after that it won't respond to any command and it needs to be reloaded. I don't get any error in the terminal and all the other commands seem to work just fine. Also, this happens to whatever query I use, whether it's 'search', 'url' or 'playlist'.

    


    const { SlashCommandBuilder } = require("@discordjs/builders")
const { EmbedBuilder } = require("discord.js")
const { QueryType } = require("discord-player")

module.exports = {
    data: new SlashCommandBuilder()
        .setName("play")
        .setDescription("Asculta muzica")
        .addSubcommand((subcommand)=>
            subcommand
                .setName("song")
                .setDescription("Incarca o singura melodie printr-un url")
                .addStringOption((option) => option.setName("url").setDescription("url-ul melodiei").setRequired(true)))
        .addSubcommand((subcommand) =>
            subcommand
                .setName("playlist")
                .setDescription("Incarca un playlist printr-un url")
                .addStringOption((option) => option.setName("url").setDescription("url-ul playlist-ului").setRequired(true)))
        .addSubcommand((subcommand) =>
            subcommand
                .setName("search")
                .setDescription("Cauta o melodie pe baza cuvintelor-cheie")
                .addStringOption((option) => 
                    option.setName("cautare").setDescription("cauta dupa titlu si autor").setRequired(true))),
        
        run: async ({ client, interaction }) => {
            if (!interaction.member.voice.channel)
                return interaction.editReply("Trebuie sa fii pe un voice channel pentru a folosi aceasta comanda!")

            const queue = await client.player.createQueue(interaction.guild)
            if (!queue.connection) await queue.connect(interaction.member.voice.channel)

            let embed = new EmbedBuilder()

            if (interaction.options.getSubcommand() === "song"){
                let url = interaction.options.getString("url")
                const result = await client.player.search(url, {
                    requestedBy: interaction.user,
                    searchEngine: QueryType.YOUTUBE_VIDEO
                })

                if (result.tracks.length === 0)
                    return interaction.editReply("Niciun rezultat")

                const song = result.tracks[0]
                await queue.addTrack(song)
                embed
                    .setColor(0xF07459)
                    .setDescription(`**[${song.title}](${song.url})** a fost adaugata`)
                    .setThumbnail(song.thumbnail)
                    .setFooter({ text: `Durata: ${song.duration}`})

            } else if (interaction.options.getSubcommand() === "playlist"){
                let url = interaction.options.getString("url")
                const result = await client.player.search(url, {
                    requestedBy: interaction.user,
                    searchEngine: QueryType.YOUTUBE_PLAYLIST
                })

                if (result.tracks.length === 0)
                    return interaction.editReply("Niciun rezultat")

                const playlist = result.playlist
                await queue.addTracks(result.tracks)
                embed
                    .setColor(0xF07459)
                    .setDescription(`**${result.tracks.length} melodii din [${playlist.title}](${playlist.url})** au fost adaugate`)

            } else if (interaction.options.getSubcommand() === "search"){
                let url = interaction.options.getString("cautare")
                const result = await client.player.search(url, {
                    requestedBy: interaction.user,
                    searchEngine: QueryType.AUTO
                })

                if (result.tracks.length === 0)
                    return interaction.editReply("Niciun rezultat")

                const song = result.tracks[0]
                await queue.addTrack(song)
                embed
                    .setColor(0xF07459)
                    .setDescription(`**[${song.title}](${song.url})** a fost adaugata`)
                    .setThumbnail(song.thumbnail)
                    .setFooter({ text: `Durata: ${song.duration}`})
            }
            if (!queue.playing) await queue.play()
            await interaction.editReply({
                embeds: [embed]
            })
                
        }
}


    


    This is the code for the [play] command. No change was done since it worked perfectly.

    


    After some research I found out that there might be a problem with the ffmpeg or the ytdl. I tried updating or reinstalling them, but the problem still remains. I would like to know if I'll need to rework the bot to find an alternative to these two.