
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (72)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 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 (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (8915)
-
Anomalie #4546 : image_recadre perd l’EXIF de rotation
19 septembre 2020, par jluc -Le 19/07/2020, cerdic dit «
On pourrait envisager que conserver les exifs à travers chaque filtre image, mais c’est aussi dangereux du point de vue des données personnelles. Je verrais plutôt un filtre qui permettrait de recopier certains exifs d’une image source sur l’image finale, sur le mode :<span class="CodeRay">[(#FICHIER|image_reduire{…}|image_recadre{…}|image_copie_exif{#FICHIER,’author’})]
</span>
(syntaxe exacte à définir)
» -
The bot doesn't play music (discord.py)
30 avril 2024, par NaydarThe code works fine, but when using the command in guild the bot enters the voice channel but doesn't play music, immediately console gives : ffmpeg process 56560 successfully terminated with return code of 3199971767.


import discord
import youtube_dl
import ffmpeg
import requests
from discord.ext import commands

class music(commands.Cog, name = 'music'):
 def __init__(self, bot):
 self.bot = bot

 self.is_playing = False
 self.is_paused = False


 self.music_queue = []
 self.YTDL_OPTIONS = {'format': 'bestaudio', 'noplaylist': 'True'}
 self.FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn -filter "volume=0.25"'}

 self.voice_client = None
 
 @commands.command(name="play")
 async def play(self, ctx, url):
 if not ctx.message.author.voice:
 await ctx.send("You are not connected to a voice channel.")
 return

 self.voice_channel = ctx.message.author.voice.channel
 if self.voice_client and self.voice_client.is_connected():
 await self.voice_client.move_to(self.voice_channel)
 else:
 self.voice_client = await self.voice_channel.connect()

 api_key = "my_key"
 video_id = url.split("v=")[1]
 api_url = f"https://www.googleapis.com/youtube/v3/videos?part=snippet&id={video_id}&key={api_key}"

 response = requests.get(api_url)
 if response.status_code == 200:
 data = response.json()
 title = data["items"][0]["snippet"]["title"]
 audio_url = f"https://www.youtube.com/watch?v={video_id}"
 self.voice_client.play(discord.FFmpegOpusAudio(audio_url))
 await ctx.send("Now playing: " + title)
 else:
 await ctx.send("Unable to fetch video information.")

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



I tried to rewrite some YTDL and FFMPEG options
(tried to replace "noplaylist" option on "False" and terminal sent :
"discord.player : ffmpeg process 51124 successfully terminated with return code of 4294967295").
Also i checked the updates of modules.


-
ffmpeg doesn't work, when starting up it doesn't play music, it gives errors
14 août 2024, par Оля Михееваimport discord
from discord import FFmpegPCMAudio
import os
import random
from gtts import gTTS
import asyncio

TOKEN="***"
VOICE_CHANNEL_ID=11122224444

class Voice_Bot(discord.Client):
 def __init__(self):
 intents = discord.Intents.default()
 intents.message_content = True
 intents.voice_states=True
 super().__init__(intents=intents)
 print(os.getcwd())
 self.sounds_hello = os.listdir(os.path.join('sounds','hello'))
 self.sounds_bye = os.listdir('sounds\\bye')
 self.sounds = os.listdir('sounds\\nature')

 async def on_ready(self): 
 self.voice_channel = self.get_channel(VOICE_CHANNEL_ID) 
 if self.voice_channel == None:
 print('Не удалось подключиться к голосовому каналу.')
 return
 self.voice_client = await self.voice_channel.connect()
 print('Бот подключен к голосовому каналу')
 await self.text_to_speech("Lets play Guess the Tune")
 
 async def on_message(self,message):
 if message.author==self.user:
 return
 if message.content.startswith("game"):
 await self.text_to_speech("let's start the game guess the melody")
 music=os.listdir("sounds\\music")
 self.melody=random.choice(music)
 await self.play_sound(f"sounds\\music\\{self.melody}")
 elif message.content==self.melody[0:len(self.melody)-4]:
 if (self.voice_client.is_playing()):
 self.voice_client.stop()
 await self.text_to_speech(f"Congratulations, {message.author.name} answered correctly! To continue, type game")
 else:
 if (self.voice_client.is_playing()):
 self.voice_client.stop()
 await self.text_to_speech(f"Unfortunately, {message.author.name} did not guess. To continue, write game")


 async def on_voice_state_update(self,member,before,after):
 if member.id ==self.user.id:
 print('Someone entered or left the voice channel.')
 else:
 try:
 if before.channel == None:
 print(f'{member.name} entered the voice channel {after.channel}.')
 await self.play_sound(f'sounds\\hello\\{random.choice(self.sounds_hello)}')
 elif after.channel == None:
 print(f'{member.name} left the voice channel {before.channel}.')
 await self.play_sound(f'sounds\\bye\\{random.choice(self.sounds_bye)}')
 except Exception as e:
 print(f"Error in on_voise_state_update: {e}")

 async def text_to_speech(self,text):
 try:
 tts = gTTS(text=text, lang ="en")
 tts.save("text.mp3")
 except Exception as e:
 print(f"Error e: {e}")
 await self.voice_channel.send(text)
 await self.play_sound("text.mp3")

 def play_sound(self,path):
 print(path)
 source=discord.FFmpegPCMAudio(source=path, executable="ffmpeg\\bin\\ffmpeg.exe")
 if (self.voice_client.is_playing()):
 self.voice_client.stop()
 self.voice_client.play(source) 

client = Voice_Bot()
client.run(TOKEN)



[enter image description here](https://i.sstatic.net/ys8Xza0w.jpg)