
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 (56)
-
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation" -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)
Sur d’autres sites (5153)
-
Skipping extractors execution since zero extractors were registered (Use `node —trace-warnings ...` to show where the warning was created)
28 septembre 2023, par Parkster00I'm following a Discord Music Bot tutorial that uses ffmpeg, here is index.js


require("dotenv").config();

const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v9");
const { Client, Collection, Intents } = require('discord.js');
const { Player } = require("discord-player");

const fs = require("node:fs");
const path = require("node:path");

const client = new Client({
 intents: ["Guilds", "GuildMessages", "GuildVoiceStates"]
});

// Set up our commands into an array
const commands = [];
client.commands = new Collection();

const commandsPath = path.join(__dirname, "commands");
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith(".js"));

for (const file of commandFiles) {
 console.log(`${file}`)
 console.log(`${commandsPath}`)
 const filePath = path.join(commandsPath, file);
 console.log(`${filePath}`)
 const command = require(filePath);

 client.commands.set(command.data.name, command);
 commands.push(command.data.toJSON());
}

// Create the player, highest quality audio
client.player = new Player(client, {
 ytdlOptions: {
 quality: "highestaudio",
 highWaterMark: 1 << 25
 }
});

// Commands are registered
client.on("ready", () => {
 const guild_ids = client.guilds.cache.map(guild => guild.id);

 const rest = new REST({ version: "9" }).setToken(process.env.TOKEN);
 for (const guildId of guild_ids) {
 rest.put(Routes.applicationGuildCommands(process.env.CLIENT_ID, guildId), {
 body: commands
 })
 .then(() => console.log(`Added commands to ${guildId}`))
 .catch(console.error);
 }

});

client.on("interactionCreate", async interaction => {
 if (!interaction.isCommand()) return;

 const command = client.commands.get(interaction.commandName);
 if (!command) return;

 try {
 await command.execute({ client, interaction });
 }
 catch (err) {
 console.error(err);
 await interaction.reply("An error occured while executing that command.");
 }
});

console.log(process.env.TOKEN);
client.login(process.env.TOKEN);



And here is play.js where I think the error originates :


const { SlashCommandBuilder } = require("@discordjs/builders");
const { EmbedBuilder } = require("discord.js");
const { QueryType } = require('discord-player');


module.exports = {
 data: new SlashCommandBuilder()
 .setName("play")
 .setDescription("Plays a song.")
 .addSubcommand(subcommand => {
 return subcommand
 .setName("search")
 .setDescription("Searches for a song.")
 .addStringOption(option => {
 return option
 .setName("searchterms")
 .setDescription("search keywords")
 .setRequired(true);
 })
 })
 .addSubcommand(subcommand => {
 return subcommand
 .setName("playlist")
 .setDescription("Plays playlist from YT")
 .addStringOption(option => {
 return option
 .setName("url")
 .setDescription("playlist url")
 .setRequired(true);

 })
 })
 .addSubcommand(subcommand => {
 return subcommand
 .setName("song")
 .setDescription("Plays song from YT")
 .addStringOption(option => {
 return option
 .setName("url")
 .setDescription("url of song")
 .setRequired(true);

 })
 }),
 execute: async ({ client, interaction }) => {

 if (!interaction.member.voice.channel) {
 await interaction.reply("You must be in a voice channel to use this command.");
 return;
 }

 const queue = await client.player.nodes.create(interaction.guild);

 if (!queue.connection) await queue.connect(interaction.member.voice.channel)

 let embed = new EmbedBuilder();
 if (interaction.options.getSubcommand() === "song") {
 let url = interaction.options.getString('url');

 const result = await client.player.search(url, {
 requestedBy: interaction.user,
 searchEngine: QueryType.YOUTUBE_VIDEO
 });

 console.log(result.tracks);

 if (result.tracks.length === 0) {
 await interaction.reply("no results found");
 return
 }

 const song = result.tracks[0];
 await queue.addTrack(song);

 embed
 .setDescription(`Added **[${song.title}](${song.url})** to the queue.`)
 .setThumbnail(song.thumbnail)
 .setFooter({ text: `Duration: ${song.duration}` });
 }

 else if (interaction.options.getSubcommand() === "playlist") {
 let url = interaction.options.getString('url');

 const result = await client.player.search(url, {
 requestedBy: interaction.SlashCommandBuilder,
 searchEngine: QueryType.YOUTUBE_PLAYLIST,
 });

 if (result.tracks.length === 0) {
 await interaction.reply("no playlist found");
 return
 }

 const playlist = result.playlist;
 await queue.addTracks(playlist);

 embed
 .setDescription(`Added **[${playlist.title}](${playlist.url})** to the queue.`)
 .setThumbnail(playlist.thumbnail)
 .setFooter({ text: `Duration: ${playlist.duration}` });
 }

 else if (interaction.options.getSubcommand() === "search") {
 let url = interaction.options.getString('searchterms');

 const result = await client.player.search(url, {
 requestedBy: interaction.SlashCommandBuilder,
 searchEngine: QueryType.AUTO,
 });

 if (result.tracks.length === 0) {
 await interaction.reply("no results found");
 return
 }

 const song = result.tracks[0]
 await queue.addTrack(song);

 embed
 .setDescription(`Added **[${song.title}](${song.url})** to the queue.`)
 .setThumbnail(song.thumbnail)
 .setFooter({ text: `Duration: ${song.duration}` });
 }

 if (!queue.playing) await queue.play();

 await interaction.reply({
 embeds: [embed]
 })
 }
}



Is ffmpeg called differently now ? Am I doing something wrong ?


I've tried different installs of Ffmpeg and none seem to work, so I'd imagine it originates somewhere in my code.


-
Audio not playing in discord bot(discord.js)
25 juin 2021, par Manas PrakashI have created a discord bot using discord.js that plays music.
But it is not playing any music...
I tried this but it didn't work, also tried installing multiple ffmpeg libraries.
Here is my Code :


const Discord = require("discord.js");
const dotenv = require("dotenv");
const ytdl = require("ytdl-core");
const ytSearch = require("yt-search");

dotenv.config();

const prefix = "#";
const queue = new Map();

let loop = false;
let count = 1;

const bot = new Discord.Client();

bot.on("ready", () => {
 bot.user.setActivity("Doomer", { type: "LISTENING" });
 console.log("Boomer Online");
});

bot.on("message", async (message) => {
 const args = message.content.slice(prefix.length + 4).split(" ");
 const voice_channel = message.member.voice.channel;
 if (!voice_channel) return;

 const server_queue = queue.get(message.guild.id);

 if (message.content.toLowerCase().startsWith(`${prefix}play`)) {
 if (message.content === `${prefix}play`)
 return message.channel.send("Pls Enter the second srgument");
 let song = {};

 if (ytdl.validateURL(args[1])) {
 const song_info = await ytdl.getInfo(args[1]);
 song = {
 title: song_info.videoDetails.title,
 url: song_info.videoDetails.video_url
 };
 } else {
 const video_finder = async (query) => {
 const video_result = await ytSearch(query);
 return video_result.videos.length > 1 ? video_result.videos[0] : null;
 };

 const video = await video_finder(args.join(" "));
 if (video) {
 song = { title: video.title, url: video.url };
 } else {
 message.channel.send("Error finding video.");
 }
 }

 if (!server_queue) {
 const queue_constructor = {
 voice_channel: voice_channel,
 text_channel: message.channel,
 connection: null,
 songs: []
 };

 queue.set(message.guild.id, queue_constructor);
 queue_constructor.songs.push(song);

 try {
 const connection = await message.member.voice.channel.join();
 queue_constructor.connection = connection;
 video_player(message.guild, queue_constructor.songs[0]);
 } catch (err) {
 queue.delete(message.guild.id);
 message.channel.send("There was an error connecting!");
 throw err;
 }
 } else {
 server_queue.songs.push(song);
 return message.channel.send(`-
-
MLT How to Mix several audio tracks to play simultaneously ?
24 septembre 2017, par user2455079I need to make video from list of video files, only some of them has sound and for some videos i need to add external soundtrack and for ALL videos and also I need to add global music that fill fade out to low volume on some videos.
melt
1.mp4" -mix 7 -mixer luma
"2 mute.mp4" -mix 7 -mixer luma
"4.mp4" -mix 7 -mixer luma
-audio-track "music.mp3" out=600 -transition mix in=0 out=600 a_track=0 b_track=1 -filter volume level="0=0;68=0;83=-21;160=-21;170=0;470=0;481=-21;500=-21;510=0"
-audio-track -blank 481 "voiceover.mp3" -transition mix in=481 a_track=0 b_track=1Everything works fine except when adding soundtrack to specified position (last string) it overwrites music.mp3 (previous string) so music is muted.
Everything needs to be mixed...How to add several sound tracks so they will play simultaneously ?