You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

voice.md 1.4 kB

12345678910111213141516171819202122232425262728
  1. # Voice
  2. **Information on this page is subject to change!**
  3. >[!WARNING]
  4. >Audio in 1.0 is incomplete. Most of the below documentation is untested.
  5. ## Installation
  6. To use Audio, you must first configure your `DiscordSocketClient` with Audio support.
  7. In your @Discord.DiscordSocketConfig, set `AudioMode` to the appropriate @Discord.Audio.AudioMode for your bot. For most bots, you will only need to use `AudioMode.Outgoing`.
  8. ### Dependencies
  9. Audio requires two native libraries, `libsodium` and `opus`. Both of these libraries must be placed in the runtime directory of your bot (for .NET 4.6, the directory where your exe is located; for .NET core, directory where your project.json is located)
  10. For Windows Users, precompiled binaries are available for your convienence [here](https://discord.foxbot.me/binaries/)
  11. For Linux Users, you will need to compile from source. [Sodium Source Code](https://download.libsodium.org/libsodium/releases/), [Opus Source Code](http://downloads.xiph.org/releases/opus/).
  12. ## Joining a Channel
  13. Joining Voice Channels is relatively straight-forward, and is a requirement for sending or receiving audio. This will also allow us to create an @Discord.Audio.IAudioClient, which will be used later to send or receive audio.
  14. [!code-csharp[Joining a Channel](samples/joining_audio.cs)]
  15. The client will sustain a connection to this channel until it is kicked, disconnected from Discord, or told to disconnect.