Recherche avancée

Médias (0)

Mot : - Tags -/gis

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

Autres articles (38)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (5130)

  • avcodec/x86/mpegvideoenc : remove av_assert2() for variable alignment

    22 août 2024, par Ramiro Polla
    avcodec/x86/mpegvideoenc : remove av_assert2() for variable alignment
    

    It's safe to assume that LOCAL_ALIGNED_16 does indeed align. Otherwise
    we would have many more problems...

    This assert was added in f8188626 all the way back in 2003.

    • [DH] libavcodec/x86/mpegvideoenc_template.c
  • fftools/ffmpeg : Remove the micor like "#if 1"

    9 novembre 2018, par Jun Zhao
    fftools/ffmpeg : Remove the micor like "#if 1"
    

    They are come from 2003 and delete them.

    Signed-off-by : Jun Zhao <mypopydev@gmail.com>

    • [DH] fftools/ffmpeg.c
  • How to create a queue system with a discord.py bot

    20 août 2024, par Zamv

    I'm trying to create a bot with discord.py.

    &#xA;

    Also, I'm a beginner, so I'll be interested in what I can improve and any errors there are.

    &#xA;

    I've been stuck on trying to create this queue system for songs, the bot was working perfectly fine and played some urls before I implemented the play_next function. Now it doesn't even play the first song, even if it sends confirmation messages both in the terminal that in the discord channel. I know that the code might be a little confusing.

    &#xA;

    I wrote two main functions : "play_next" to play the next song in the queue and "play", the main command. Here is my play_next function :

    &#xA;

    async def play_next(self,ctx):&#xA;        if not ctx.voice_client.is_playing: #(don&#x27;t know if this is correct as I also check if the bot isn&#x27;t                     playing anything in the play function)&#xA;            &#xA;            if self.song.queue: &#xA;                next_song = self.song_queue.pop(0) #deleting the first element of the queue, so if we have (song_0, song_1 and song_2) the bot should delete (song_0) making in fact song_1 the "next" song_0&#xA;                try:&#xA;                    ctx.voice_client.play(discord.FFmpegPCMAudio(next_song), &#xA;                                          after=lambda e: self.bot.loop.create_task(self.play_next(ctx))) #Not gonna lie here, i asked chat gpt for this line, it should make the bot automatically play the next song one after another, correct me if I am wrong&#xA;&#xA;#this is not important&#xA;                    embed = discord.Embed(&#xA;                        title="Song",&#xA;                        description=f"Now playing {next_song}",&#xA;                        color = 0x1DB954&#xA;                    )&#xA;                    await ctx.send(embed=embed)&#xA;                except Exception as e:&#xA;                    print(f"Error playing the next song: {e}")&#xA;&#xA;            else:&#xA;                await ctx.voice_client.disconnect()  # disconnecting from the voice channel if the queue is empty&#xA;                print("Disconnected from the voice channel as the queue is empty.")&#xA;

    &#xA;

    I think that the main problem of my bot is the play_next function, but here it is my "play" function :

    &#xA;

        @commands.command(pass_context=True)&#xA;    async def play(self, ctx, url: str):  &#xA;        if ctx.author.voice:  # first checking if the user is in a voice channel&#xA;            if not ctx.voice_client: #then checking if the bot is already connected to a voice channel&#xA;                channel = ctx.message.author.voice.channel &#xA;                try:&#xA;                    await channel.connect()  #then joining&#xA;                    print("I joined the voice channel!")&#xA;                except Exception as e:&#xA;                    print(f"Failed to connect to the voice channel: {e}")&#xA;                    return&#xA;&#xA;            song_path = f"song_{self.song_index}.mp3" #note, im using cogs, i declared self.song_index with the value of 0 &#xA;            self.song_index &#x2B;= 1 #i thought that this was the easiest way of creating a new file for each song&#xA;&#xA;            ydl_opts = {&#xA;                &#x27;format&#x27;: &#x27;bestaudio/best&#x27;,&#xA;                &#x27;postprocesors&#x27;: [{&#xA;                    &#x27;key&#x27;: &#x27;FFmpegExtractAudio&#x27;,&#xA;                    &#x27;preferredcodec&#x27;: &#x27;mp3&#x27;,&#xA;                    &#x27;preferredquality&#x27;: &#x27;192&#x27;,&#xA;                }],&#xA;                &#x27;outtmpl&#x27;: song_path&#xA;            }&#xA;            try:&#xA;                with youtube_dl.YoutubeDL(ydl_opts) as ydl:&#xA;                    print("Starting download...")&#xA;                    ydl.download([url]) #this is where it should download the song provided by the url&#xA;                    print("Download finished.")&#xA;            except Exception as e:&#xA;                await ctx.send(f"Failed to download the song: {e}")&#xA;                return&#xA;&#xA;#i think that the next two if statements are the main threats&#xA;            if os.path.exists(song_path): #if there is atleast 1 song in the queue&#xA;                self.song_queue.append(song_path) #append the next one&#xA;                embed = discord.Embed(&#xA;                    title="Added to Queue!",&#xA;                    description = f"{url} has been added to the queue.",&#xA;                    color=0x33ff33&#xA;                )&#xA;                await ctx.send(embed=embed)&#xA;&#xA;&#xA;                if not ctx.voice_client.is_playing(): #checking if the bot is already playing something, don&#x27;t know if i should put this if statement here&#xA;                    print("Starting playback...")&#xA;                    await self.play_next(ctx) #if nothing is playing, then the bot should play the next song&#xA;&#xA;&#xA;&#xA;            else:&#xA;                await ctx.send("Failed to download or find the audio file.")&#xA;&#xA;        else:&#xA;            embed = discord.Embed(&#xA;                title="❌You must be in a voice channel",&#xA;                color=0xff6666&#xA;            )&#xA;            await ctx.send(embed=embed)&#xA;

    &#xA;