
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (81)
-
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. -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...)
Sur d’autres sites (10635)
-
ffmpeg on replit (discord audio player)
11 mai 2022, par mohammad5615im trying to make discord audio file player on Replit but i cant install ffmpeg


my bot source


import discord
import discord.ext
from time import sleep
import os
import ffmpeg
import replit
#from keep_alive import keep_alive


client = discord.Client()


@client.event
async def on_ready():
 channel = client.get_channel(714375630233403442)
 voice = await channel.connect()

 
 voice.play(discord.FFmpegPCMAudio('song.mp3'))
 print('Done')

#keep_alive()

client.run(os.getenv('TOKEN'))


input('Press Enter to Exit (5):')
input('Press Enter to Exit (4):')
input('Press Enter to Exit (3):')
input('Press Enter to Exit (2):')
input('Press Enter to Exit (1):')





i run this cod on replit and i get this error


Ignoring exception in on_ready
Traceback (most recent call last):
 File "/home/runner/Discord-Bot-2/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
 await coro(*args, **kwargs)
 File "main.py", line 19, in on_ready
 voice.play(discord.FFmpegPCMAudio('song.mp3'))
 File "/home/runner/Discord-Bot-2/venv/lib/python3.8/site-packages/discord/player.py", line 225, in __init__
 super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
 File "/home/runner/Discord-Bot-2/venv/lib/python3.8/site-packages/discord/player.py", line 138, in __init__
 self._process = self._spawn_process(args, **kwargs)
 File "/home/runner/Discord-Bot-2/venv/lib/python3.8/site-packages/discord/player.py", line 147, in _spawn_process
 raise ClientException(executable + ' was not found.') from None
discord.errors.ClientException: ffmpeg was not found.



The error cod image (cant find ffmpeg)


-
How to delete mp3 file after the bot played it
8 mars 2021, par EckigerLucaI am trying to create a music bot and now I want the bot to delete the current playing song after it finished playing. There's my code :


import asyncio

import os
import discord
from discord.embeds import Embed
from discord.file import File
from discord.player import AudioPlayer
from youtube_dl.utils import smuggle_url, update_url_query
from youtube_search import YoutubeSearch
import discord
from discord.ext.commands import bot
import youtube_dl
from discord.ext import commands
from youtube_dl import YoutubeDL

youtube_dl.utils.bug_reports_message = lambda: ''

ytdl_format_options = {
 'format': 'bestaudio/best',
 'outtmpl': '/music_files/%(id)s.mp3',
 'restrictfilenames': True,
 'noplaylist': True,
 'nocheckcertificate': True,
 'ignoreerrors': False,
 'logtostderr': False,
 'quiet': True,
 'no_warnings': True,
 'default_search': 'auto',
 'source_address': '0.0.0.0' 
}

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

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


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

 self.data = data

 self.title = data.get('title')
 self.thumbnail = data.get('thumbnail')
 self.url = data.get('webpage_url')
 self.uploader = data.get('uploader')
 self.uploader_url = data.get('uploader_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 play(self, ctx, *, url):
 global player
 """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('Player error: %s' % e) if e else None)

 await ctx.send("Started playing!")
 @play.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()

def setup(client):
 client.add_cog(Music(client))



It's saving the files to a folder called "music_files" with the format videoid.mp3
I noticed that it's logging something in the cmd when
logging.basicConfig(level=logging.INFO)
is added to the main.py file under the imports, is there maybe a way to use it ?

Note : The code is a modified version of basic_voice.py by Rapptz.


Edit : I found a way :


folder = './music_files'
 for song in os.listdir(folder):
 file_path = os.path.join(folder, song)
 try:
 if os.path.isfile(file_path) or os.path.islink(file_path):
 os.unlink(file_path)
 elif os.path.isdir(file_path):
 shutil.rmtree(file_path)
 except Exception as e:
 print('Failed to delete %s. Reason %s' % (file_path, e))



-
android - how to play two audio file at same time
29 janvier 2016, par Sajad NorouziI wanna create an karaoke android app. so far, user can listen to the song and record his voice. now I want to let user some editing like setting volume of his voice or setting Reverb effect. I have some library like ffmpeg and sox on android and don’t have problem for mixing two audio, but for setting volume or Reverb wanna play two audio file simultaneously using mediaplayer, however it’s not possible because android doesn’t let us play two audio file with mediaplayer at same time even with two different object of mediaplayer. so, what is the solution ?