
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (41)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (10194)
-
Evolution #4149 : UI System Fonts pour l’espace privé
1er juillet 2018, par Peet duGithub et Bootstrap on fait marche arrière. Manifestement trop de problèmes sous Windows.
voir Not ready yet : https://infinnie.github.io/blog/2017/systemui.htmlSans doute peut on fermer ce ticket et en ouvrir un autre concernant Typo et taille de typo pour le back-office ?
-
OpenAI Whisper : FileNotFoundError : [WinError 2] The system cannot find the file specified
16 décembre 2023, par AlexI'm not the first to get this error, however, all previous answers relate to ffmpeg not installed. As you can see, I installed ffmpeg so not sure why i still get this error. Moreover, this code works perfectly fine in Google Colab but not in Spyder.


pip install tiktoken

pip install -U openai-whisper

pip install ffmpeg

pip install setuptools-rust

import whisper

model = whisper.load_model("medium")

result = model.transcribe("F:/iim/dahl/01.Projects/20231215_Schlueter/02.Code/01.Data/The Investors Everybody Ignored ft Sallie Krawcheck Whats Your Problem Jacob Goldstein.mp3")
print(result["text"])



 Cell In[13], line 1
 result = model.transcribe("F:/iim/dahl/01.Projects/20231215_Schlueter/02.Code/01.Data/The Investors Everybody Ignored ft Sallie Krawcheck Whats Your Problem Jacob Goldstein.mp3/")

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\whisper\transcribe.py:122 in transcribe
 mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\whisper\audio.py:140 in log_mel_spectrogram
 audio = load_audio(audio)

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\whisper\audio.py:58 in load_audio
 out = run(cmd, capture_output=True, check=True).stdout

 File F:\iim\dahl\00.Anaconda\Lib\subprocess.py:548 in run
 with Popen(*popenargs, **kwargs) as process:

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\spyder_kernels\customize\spydercustomize.py:109 in __init__
 super(SubprocessPopen, self).__init__(*args, **kwargs)

 File F:\iim\dahl\00.Anaconda\Lib\subprocess.py:1026 in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,

 File F:\iim\dahl\00.Anaconda\Lib\subprocess.py:1538 in _execute_child
 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden




-
How to create a queue system with a discord.py bot
20 août 2024, par ZamvI'm trying to create a bot with discord.py.


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


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.


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 :


async def play_next(self,ctx):
 if not ctx.voice_client.is_playing: #(don't know if this is correct as I also check if the bot isn't playing anything in the play function)
 
 if self.song.queue: 
 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
 try:
 ctx.voice_client.play(discord.FFmpegPCMAudio(next_song), 
 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

#this is not important
 embed = discord.Embed(
 title="Song",
 description=f"Now playing {next_song}",
 color = 0x1DB954
 )
 await ctx.send(embed=embed)
 except Exception as e:
 print(f"Error playing the next song: {e}")

 else:
 await ctx.voice_client.disconnect() # disconnecting from the voice channel if the queue is empty
 print("Disconnected from the voice channel as the queue is empty.")



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


@commands.command(pass_context=True)
 async def play(self, ctx, url: str): 
 if ctx.author.voice: # first checking if the user is in a voice channel
 if not ctx.voice_client: #then checking if the bot is already connected to a voice channel
 channel = ctx.message.author.voice.channel 
 try:
 await channel.connect() #then joining
 print("I joined the voice channel!")
 except Exception as e:
 print(f"Failed to connect to the voice channel: {e}")
 return

 song_path = f"song_{self.song_index}.mp3" #note, im using cogs, i declared self.song_index with the value of 0 
 self.song_index += 1 #i thought that this was the easiest way of creating a new file for each song

 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocesors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 'outtmpl': song_path
 }
 try:
 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 print("Starting download...")
 ydl.download([url]) #this is where it should download the song provided by the url
 print("Download finished.")
 except Exception as e:
 await ctx.send(f"Failed to download the song: {e}")
 return

#i think that the next two if statements are the main threats
 if os.path.exists(song_path): #if there is atleast 1 song in the queue
 self.song_queue.append(song_path) #append the next one
 embed = discord.Embed(
 title="Added to Queue!",
 description = f"{url} has been added to the queue.",
 color=0x33ff33
 )
 await ctx.send(embed=embed)


 if not ctx.voice_client.is_playing(): #checking if the bot is already playing something, don't know if i should put this if statement here
 print("Starting playback...")
 await self.play_next(ctx) #if nothing is playing, then the bot should play the next song



 else:
 await ctx.send("Failed to download or find the audio file.")

 else:
 embed = discord.Embed(
 title="❌You must be in a voice channel",
 color=0xff6666
 )
 await ctx.send(embed=embed)