Discord.Addons.SimpleAudio 1.0.0-rc2

This is a prerelease version of Discord.Addons.SimpleAudio.
dotnet add package Discord.Addons.SimpleAudio --version 1.0.0-rc2
NuGet\Install-Package Discord.Addons.SimpleAudio -Version 1.0.0-rc2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Discord.Addons.SimpleAudio" Version="1.0.0-rc2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Discord.Addons.SimpleAudio --version 1.0.0-rc2
#r "nuget: Discord.Addons.SimpleAudio, 1.0.0-rc2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Discord.Addons.SimpleAudio as a Cake Addin
#addin nuget:?package=Discord.Addons.SimpleAudio&version=1.0.0-rc2&prerelease

// Install Discord.Addons.SimpleAudio as a Cake Tool
#tool nuget:?package=Discord.Addons.SimpleAudio&version=1.0.0-rc2&prerelease

Discord.Addons.SimpleAudio

Easy-to-use implementation for playing music with Discord.Net 1.0.

Prerequisites

You need FFMpeg, opus, and libsodium. You can download these for your platform here. You need to rename libopus.dll to opus.dll before use.

  • Add opus and libsodium by right-clicking your project in Solution Explorer → Add → Existing Item. Go to their properties and set them to Copy Always.

alternate text is missing from this package README image

Quickstart

  1. If you want your users to be able to use commands to control the audio player, create a new class to manage those commands.
using Discord.Addons.SimpleAudio;

public class AudioModuleImplementation : AudioModule
{
    // Add the [Command] attribute, remember to set all your commands
    // in this module to 'Runmode.Async'.
    // Add preconditions if you want more granular control.
    [Command("join", RunMode = RunMode.Async)]
    public override Task JoinCmd(IVoiceChannel target = null)
    {
        // All you need to do is call the base version
        // of the commmand.
        return base.JoinCmd(target);
    }
}
  1. During your bot initialization, create an AudioConfig object that contains at the very least, the path for ffmpeg.exe and the base path for the music you want to play:
var audioCfg = new AudioConfig(
    ffmpegPath: @"C:\ffmpeg-folder\bin\ffmpeg.exe",
    musicBasePath: @"C:\bot_music")
{
    // You can provide guild-specific configurations
    // by using the following property and syntax sugar:
    GuildConfigs =
    {
        // C#6+ syntax
        [guildId] = new StandardAudioGuildConfig
        {
            // Consult IntelliSense for the
            // properties you can set here.
            AutoPlay = true
        }
    },

    // You can also set some properties globally
    // NOTE: If a guild-specific option is specified,
    // that takes precedence over the global option.
    AutoPlay = false
};
  1. Finally, add the AudioService to your service collection and your module implementation to your CommandService:
_serviceCollection.AddSingleton(new AudioService(_client, audioCfg, _logger));
//...
await _commands.AddModuleAsync<AudioModuleImplementation>();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-rc2 980 1/17/2018