
Recherche avancée
Médias (91)
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (48)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP 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 (6580)
-
How to copy metadata exported from mp3 file (with ffmpeg) int another mp3 file
11 septembre 2022, par SrulyI have 2 mp3 files with the same content but with different speed and volume level. I would like to copy the metadata from one to the other and only the metadata. I have seen this post, and was able to extract the metadata to a file. But now when I try to copy the metadata to the second file as described in that post, it copies the whole file as well. This then overwrites the audio itself as well as the metadata.


How can I only copy the metadata into the second file without copying the actual audio.


-
Add audios according to their timestamps with ffmpeg
27 novembre 2020, par user14706760I tried this :


ffmpeg -i first.mka -i second.mka -i third.mka -i fourth.mka
 -filter_complex
 "[1]adelay=184000|184000[b];
 [2]adelay=360000|360000[c];
 [3]adelay=962000|962000[d];
 [0][b][c][d]amix=4"
merged.mka



But it turned out that
amix
scales each input's volume by1/n
wheren
= no. of active inputs. A normalization workaround is unacceptable in my case because I have hundreds of inputs. Is the any alternative way to add audio files according to their timestamps ?

-
Discord.py repository example : bot can join voice channel, shows voice activity (green ring), but no sound is produced ?
19 juin 2023, par Jared RobertsonI copied an example from the discord.py repository to test out a bot with music capabilities. Though the code enables YouTube playback, I am only concerned with local audio playback. See code here : https://github.com/Rapptz/discord.py/blob/v2.3.0/examples/basic_voice.py. I tested this code as is with only the Discord token portion updated (from constants.py). See code below :


# This example requires the 'message_content' privileged intent to function.

#my constants.py with API keys, tokens, etc. stored
import constants

import asyncio

import discord
import youtube_dl

from discord.ext import commands

# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''


ytdl_format_options = {
 'format': 'bestaudio/best',
 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0', # bind to ipv4 since ipv6 addresses cause issues sometimes
}

ffmpeg_options = {
 'options': '-vn',
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source, *, data, volume=0.5):
 super().__init__(source, volume)

 self.data = data

 self.title = data.get('title')
 self.url = data.get('url')

 @classmethod
 async def from_url(cls, url, *, loop=None, stream=False):
 loop = loop or asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))

 if 'entries' in data:
 # take first item from a playlist
 data = data['entries'][0]

 filename = data['url'] if stream else ytdl.prepare_filename(data)
 return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)


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

 @commands.command()
 async def join(self, ctx, *, channel: discord.VoiceChannel):
 """Joins a voice channel"""

 if ctx.voice_client is not None:
 return await ctx.voice_client.move_to(channel)

 await channel.connect()

 @commands.command()
 async def play(self, ctx, *, query):
 """Plays a file from the local filesystem"""

 source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(query))
 ctx.voice_client.play(source, after=lambda e: print(f'Player error: {e}') if e else None)

 await ctx.send(f'Now playing: {query}')

 @commands.command()
 async def yt(self, ctx, *, url):
 """Plays from a url (almost anything youtube_dl supports)"""

 async with ctx.typing():
 player = await YTDLSource.from_url(url, loop=self.bot.loop)
 ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None)

 await ctx.send(f'Now playing: {player.title}')

 @commands.command()
 async def stream(self, ctx, *, url):
 """Streams from a url (same as yt, but doesn't predownload)"""

 async with ctx.typing():
 player = await YTDLSource.from_url(url, loop=self.bot.loop, stream=True)
 ctx.voice_client.play(player, after=lambda e: print(f'Player error: {e}') if e else None)

 await ctx.send(f'Now playing: {player.title}')

 @commands.command()
 async def volume(self, ctx, volume: int):
 """Changes the player's volume"""

 if ctx.voice_client is None:
 return await ctx.send("Not connected to a voice channel.")

 ctx.voice_client.source.volume = volume / 100
 await ctx.send(f"Changed volume to {volume}%")

 @commands.command()
 async def stop(self, ctx):
 """Stops and disconnects the bot from voice"""

 await ctx.voice_client.disconnect()

 @play.before_invoke
 @yt.before_invoke
 @stream.before_invoke
 async def ensure_voice(self, ctx):
 if ctx.voice_client is None:
 if ctx.author.voice:
 await ctx.author.voice.channel.connect()
 else:
 await ctx.send("You are not connected to a voice channel.")
 raise commands.CommandError("Author not connected to a voice channel.")
 elif ctx.voice_client.is_playing():
 ctx.voice_client.stop()


intents = discord.Intents.default()
intents.message_content = True

bot = commands.Bot(
 command_prefix=commands.when_mentioned_or("!"),
 description='Relatively simple music bot example',
 intents=intents,
)


@bot.event
async def on_ready():
 print(f'Logged in as {bot.user} (ID: {bot.user.id})')
 print('------')


async def main():
 async with bot:
 await bot.add_cog(Music(bot))
 #referenced my discord token in constants.py
 await bot.start(constants.discord_token)


asyncio.run(main())



This code should cause the Discord bot to join the voice channel and play a local audio file when the message " !play query" is entered into the Discord text channel, with query in my case being "test.mp3." When " !play test.mp3" is entered, the bot does join the voice channel and appears to generate voice activity, however no sound is heard. No errors are thrown in the output. The bot simply continues on silently.


Here's what I've checked and tried :


- 

-
I am in the Discord voice channel. The code will alert that user is not in the voice channel if a user attempts to summon the bot without being in a voice channel.


-
FFmpeg is installed and added to PATH. I even stored a copy of the .exe in the project folder.


-
I've tried specifying the full path of both FFmpeg (adding the "executable=" arg to the play function) and the audio file (stored at C :/test.mp3 and a copy in the project folder).


-
All libraries up to date.


-
Reviewed discord.py docs (https://discordpy.readthedocs.io/en/stable/api.html#voice-related) and played around with opuslib (docs say not necessary on Windows, which I'm on) and FFmpegOpusAudio, but results were the same.


-
Referenced numerous StackOverflow threads, including every one suggested when I typed the title of this post. Tried each suggestion individually and in various combinations when possible. See a few below :
Discord.py music_cog, bot joins channel but plays no sound
Discord.py Music Bot doesn’t play music
Discord.py Bot Not Playing music


-
Double checked my sound is on and volume turned up. My sound is working I can hear the Discord notification when the bot joins the voice channel.


-
Issue is the same if I try to play a YouTube file with !yt command. Bot joins channel fine but no sound is produced.




















That's everything I can think of at the moment. There seem to be many posts regarding this exact topic and also variations of it. I've been unable to find a clear and consistent answer, nor one the works for me. I am willing to try anything at this point as it is obviously possible, but for whatever reason success eludes me. Thank you in advance for any assistance you are willing to offer.


-