
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (44)
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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. -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (7352)
-
Google Optimize vs Matomo A/B Testing : Everything You Need to Know
17 mars 2023, par Erin — Analytics Tips -
Why is my DSharpPlus Slash Command not playing my desired sound using FFMPEG in C# ?
19 mai 2023, par IngeniousThoughtsI'm having a problem with my ffmpeg setup the commands work fine but my play command doesn't play my desired sound.


//The command.
 [SlashCommand("play", "plays a sound in a voice channel.")]
 public async Task HowlCommand(InteractionContext ctx, [Choice("ChoiceName", "C:\\My\\Program\\Directory\\Name\\MySound.mp3")]
 [Option("Sound", "Please select a Sound")] string filepath)
 {
 //Creates a slash command used response.
 //Also removes the error message.
 await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder()
 .WithContent("Playing sound in voice channel. Please wait just a moment!"));
 
 //Checks if the user is not a bot to send the message.
 if (ctx.Member.IsBot)
 {
 return;
 }
 else
 {
 if(filepath != "C:\\My\\Program\\Directory\\Name\\MySound.mp3")
 {
 var embedmessage = new DiscordMessageBuilder()
 .AddEmbed(new DiscordEmbedBuilder()
 
 .WithAuthor("BotName", null, ctx.Client.CurrentApplication.Icon)
 .WithTitle("Please select the following sound to play:")
 .WithImageUrl(ctx.Client.CurrentApplication.Icon)
 .WithFooter("VoiceChannel Error.", "ImageURL.png")
 .WithTimestamp(DateTime.Now)
 .Build()
 
 );
 
 //Makes the command wait 5 seconds before sending the rest of the command data.
 await Task.Delay(TimeSpan.FromSeconds(5));
 
 //Sends the embed in a message.
 await ctx.Channel.SendMessageAsync(embedmessage);
 }
 else
 {
 //Makes the command wait 5 seconds before sending the rest of the command data.
 await Task.Delay(TimeSpan.FromSeconds(5));
 
 
 var vnext = ctx.Client.GetVoiceNext();
 var vnc = vnext.GetConnection(ctx.Guild);
 
 //if null throws exception.
 if (vnc == null)
 throw new System.InvalidOperationException("Not connected in this guild.");
 
 
 //Gets the mp3 file to use.
 var ffmpeg = Process.Start(new ProcessStartInfo
 {
 FileName = "ffmpeg",
 Arguments = $@"-i ""{filepath}"" -ac 2 -f s16le -ar 48000 pipe:1",
 RedirectStandardOutput = true,
 UseShellExecute = false
 });
 Stream pcm = ffmpeg.StandardOutput.BaseStream;
 
 VoiceTransmitSink transmit = vnc.GetTransmitSink();
 await pcm.CopyToAsync(transmit);
 vnc.GetTransmitSink().VolumeModifier = 5;
 
 //Makes the command wait 10 seconds before sending the rest of the command data.
 await Task.Delay(TimeSpan.FromSeconds(10));
 
 //Disconnects the bot from the voice channel.
 vnc.Disconnect();
 }
 }
 }



//The command.
 [SlashCommand("join", "Joins a voice channel.")]
 public async Task JoinChannel(InteractionContext ctx, [Choice("MyVoiceChannel", "VoiceChannelName")]
 [Option("VoiceChannel", "Please choose a Voice Channel.")] DiscordChannel channel)
 {
 //Creates a slash command used response.
 //Also removes the error message.
 await ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, new DiscordInteractionResponseBuilder()
 .WithContent("Joining voice channel. Please wait just a moment!"));
 
 //Checks if the user is not a bot to send the message.
 if (ctx.Member.IsBot)
 {
 return;
 }
 else
 {
 if (channel.Name != "MyVoiceChannelName")
 {
 var embedmessage = new DiscordMessageBuilder()
 .AddEmbed(new DiscordEmbedBuilder()
 
 .WithAuthor("BotName", null, ctx.Client.CurrentApplication.Icon)
 .WithTitle("Please Create The Following Voice Channel:")
 .WithImageUrl(ctx.Client.CurrentApplication.Icon)
 .AddField("VoiceChannel:", "**BotName**" + Environment.NewLine + "Is Case Sensitive: **Yes**")
 .WithFooter("VoiceChannel Error.", "ImageURL.png")
 .WithTimestamp(DateTime.Now)
 .Build()
 
 );
 
 //Makes the command wait 5 seconds before sending the rest of the command data.
 await Task.Delay(TimeSpan.FromSeconds(5));
 
 //Sends the embed in a message.
 await ctx.Channel.SendMessageAsync(embedmessage);
 }
 else
 {
 //Makes the command wait 5 seconds before sending the rest of the command data.
 await Task.Delay(TimeSpan.FromSeconds(5));
 
 
 channel = ctx.Member.VoiceState?.Channel;
 await channel.ConnectAsync();
 
 }
 }
 }
 
 }
}



public sealed class Program
 {
 public static DiscordClient Client { get; private set; }
 public static InteractivityExtension Interactivity { get; private set; }
 public static CommandsNextExtension Commands { get; private set; }
 public static VoiceNextExtension VoiceNext { get; private set; }
 
 
 static async Task Main(string[] args)
 {
 
 //Main Window configs specifying the title name and color.
 Console.BackgroundColor = ConsoleColor.Black;
 Console.ForegroundColor = ConsoleColor.Magenta;
 Console.Title = "BotName";
 
 //1. Get the details of your config.json file by deserialising it
 var configJsonFile = new JSONReader();
 await configJsonFile.ReadJSON();
 
 //2. Setting up the Bot Configuration
 var discordConfig = new DiscordConfiguration()
 {
 Intents = DiscordIntents.All,
 Token = configJsonFile.token,
 TokenType = TokenType.Bot,
 AutoReconnect = true
 };
 
 //3. Apply this config to our DiscordClient
 Client = new DiscordClient(discordConfig);
 
 //4. Set the default timeout for Commands that use interactivity
 Client.UseInteractivity(new InteractivityConfiguration()
 {
 Timeout = TimeSpan.FromMinutes(2)
 });
 
 //5. Set up the Task Handler Ready event
 Client.Ready += OnClientReady;
 
 //6. Set up the Commands Configuration
 var commandsConfig = new CommandsNextConfiguration()
 {
 StringPrefixes = new string[] { configJsonFile.prefix },
 EnableMentionPrefix = true,
 EnableDms = true,
 EnableDefaultHelp = false,
 };
 
 Commands = Client.UseCommandsNext(commandsConfig);
 
 //7. Register your commands
 var slashCommandsConfig = Client.UseSlashCommands();
 slashCommandsConfig.RegisterCommands<mysoundscommand>(MyGuildID);
 
 //8. Allows usage of voice channels.
 var VoiceNext = Client.UseVoiceNext();
 
 //9. Connect to get the Bot online
 await Client.ConnectAsync();
 await Task.Delay(-1);
 }
 
 private static Task OnClientReady(DiscordClient sender, ReadyEventArgs e)
 {
 return Task.CompletedTask;
 }
 }
</mysoundscommand>


SourceCode Link :




playing the playsound slash command but wasn't expecting it to not play the mp3 file.


everything else worked fine except when it transmits the sound it doesn't play it.


-
Révision 101151 : Mise à jour de librairie getid3 en 1.9.13
17 décembre 2016, par kent1@arscenic.infohttps://github.com/JamesHeinrich/getID3/releases/tag/v1.9.13
bugfix #89 : ID3v2.4 custom genres with slashes
bugfix #88 : large QuickTime files exceed PHP memory limit
bugfix #87 : ID3v2 write GRID data not working properly
bugfix #86 : Increase autoloading definitions
bugfix #84 : ID3v2 available writable frames list
bugfix #82 : ID3v2 datetime logic
bugfix #80 : attempt to autodetect ID3v1 encoding
bugfix #77 : add partial support of DSSv6
bugfix #76 : add mysqli version of caching extension
bugfix #75 : mysql cache max key length
bugfix #71 : custom error handler to catch exif_read_data() errors
bugfix #71 : add support for mb_convert_encoding
bugfix #70 : ID3v2 POPM / UFID
bugfix #68 : workaround broken iTunes ID3v2
bugfix #48 : Quicktime set MIME to video/mp4 where applicable
bugfix #1930 fread on pipes
bugfix #1926 relax ID3v2.IsValidURL check