Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (65)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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

Sur d’autres sites (7587)

  • Discord.py music_cog, bot joins channel but plays no sound

    20 juin 2021, par Ozzy

    I have started using python a week ago or so. I have watched all the related videos on YT and checked google pages etc. But still no luck. My bot perfectly joins to the voice channel and when i use play it downloads and presumebly starts the play function but there is no sound or anything, it just joins and waits 1-2 mins then leaves with timeout error.

    


    from discord.ext import commands
import logging

from youtube_dl import YoutubeDL

logging.basicConfig(level=logging.INFO)


class music_cog(commands.Cog):
    def __init__(self, bot):
        self.bot = bot

        # all the music related stuff
        self.is_playing = False

        # 2d array containing [song, channel]
        self.music_queue = []
        self.YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True', 'no_warnings': 'False'}
        self.FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
                               'options': '-vn'}

        self.vc = ""

    # searching the item on youtube
    def search_yt(self, item):
        with YoutubeDL(self.YDL_OPTIONS) as ydl:
            try:
                info = ydl.extract_info("ytsearch:%s" % item, download=False)['entries'][0]
            except Exception:
                return False

        return {'source': info['formats'][0]['url'], 'title': info['title']}

    def play_next(self):
        if len(self.music_queue) > 0:
            self.is_playing = True

            # get the first url
            m_url = self.music_queue[0][0]['source']

            # remove the first element as you are currently playing it
            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
        else:
            self.is_playing = False

    # infinite loop checking
    async def play_music(self):
        if len(self.music_queue) > 0:
            self.is_playing = True

            m_url = self.music_queue[0][0]['source']

            # try to connect to voice channel if you are not already connected

            if self.vc == "" or not self.vc.is_connected() or self.vc == None:
                self.vc = await self.music_queue[0][1].channel.connect()
            else:
                await self.vc.move_to(self.music_queue[0][1])

            print(self.music_queue)
            # remove the first element as you are currently playing it
            self.music_queue.pop(0)

            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())
        else:
            self.is_playing = False

    @commands.command(name="play", help="Plays a selected song from youtube")
    async def p(self, ctx, *args):
        query = " ".join(args)

        voice_channel = ctx.author.voice
        if voice_channel is None:
            # you need to be connected so that the bot knows where to go
            await ctx.send("Connect to a voice channel!")
        else:
            song = self.search_yt(query)
            if type(song) == type(True):
                await ctx.send(
                    "Could not download the song. Incorrect format try another keyword. This could be due to playlist or a livestream format.")
            else:
                await ctx.send("Song added to the queue")
                self.music_queue.append([song, voice_channel])

                if self.is_playing == False:
                    await self.play_music()

    @commands.command(name="queue", help="Displays the current songs in queue")
    async def q(self, ctx):
        retval = ""
        for i in range(0, len(self.music_queue)):
            retval += self.music_queue[i][0]['title'] + "\n"

        print(retval)
        if retval != "":
            await ctx.send(retval)
        else:
            await ctx.send("No music in queue")

    @commands.command(name="skip", help="Skips the current song being played")
    async def skip(self, ctx):
        if self.vc != "" and self.vc:
            self.vc.stop()
            await ctx.send("Stopped!")
            # try to play next in the queue if it exists
            await self.play_music()
            await ctx.send("Skipped!")


def setup(bot):
    bot.add_cog(music_cog(bot))


    


    I enabled logs to be sure, when it connects there's just that info :

    


    INFO:discord.voice_client:Connecting to voice... | INFO:discord.voice_client:Starting voice handshake... (connection attempt 1)

    


    I have also checked FFMPEG and its Path, tried different codes and methods but even though they work there is no sound. Also I installed discord.py[voice] too.

    


    I appreciate help already, thanks.

    


  • Adding background audio in FFMPEG, but quieting it if there is sound in another channel

    9 septembre 2021, par Connor Bell

    I'm appending several videos together with FFMPEG. Some of these videos have accompanying audio, and some do not.

    


    I'd like to add music in the background, and have found out how to do so from here. However, I'd like the background music to be (let's say 80%) quieter if there is already audio in that video. Note that all videos have a null audio track, so just checking for the existence of an audio track isn't sufficient.

    


    My current process is :

    


      

    • Take source videos, add a null audio source and upscale (The null audio source is required for ffmpeg-concat to work due to a bug, I think)
    • 


    • Combine the videos using ffmpeg-concat
    • 


    


    Preferably, adding the background music should be the third step, as splitting the background music prior to combining the videos sounds more complex, but I may be wrong.

    


  • My discord bot (python) isn't connecting to voice channel

    24 juin 2023, par BeanieYi

    My discord bot for some reason is not connecting to my voice channel when I type
 !play some url ... My bot is running because I've ran other tests on it. No error messages show up, so I'm lost as to why it's not working. This is the part of the code where it commands to bot to connect

    


        async def play_song(self, ctx):
        """
        Function plays music. Checks if user in voice channel
        """
        if len(self.queue) > 0:
            self.play = True
            url = self.queue[0][0]["source"]

            if self.vc is None or not self.vc.is_connected():   # If not in voice channel
                self.vc = await self.queue[0][1].connect()  # Wait until user joins channel
                if self.vc == None: # If user doesn't join channel, quit
                    await ctx.send("Could not connect D:")
                    return  
            else:
                await self.vc.move_to(self.queue[0][1]) # Moves bot to channel user is in

            self.queue.pop(0) 
            self.vc.play(discord.FfmpegPCMAudio(url, **self.ffmpeg_options), after=lambda e: self.next_song()) 
        else:
            self.play = False


    


    I added the following code below because this was the "new" method for cog, but it didn't yield any results for me. I also made sure my bot had permission on Discord to join channels and talk.

    


    async def setup(bot):
    await bot.add_cog(Event(bot))