Re-implement voice sending.

This is a complete redesign of the old voice code.

A list of major changes is as follows:

* The voice websocket will now automatically reconnect with
  exponential back-off just like the regular Client does.
* Removal of the stream player concept.
* Audio now gracefully pauses and resumes when a disconnect is found.
* Introduce a discord.AudioSource concept to abstract streams
* Flatten previous stream player functionality with the
  VoiceClient, e.g. player.stop() is now voice_client.stop()
* With the above re-coupling this means you no longer have to
  store players anywhere.
* The after function now requires a single parameter, the error,
  if any existed. This will typically be None.

A lot of this design is experimental.
This commit is contained in:
Rapptz
2017-04-18 02:29:43 -04:00
parent 38fd0928df
commit 3b1b26ffb1
11 changed files with 609 additions and 537 deletions

View File

@ -40,6 +40,21 @@ Client
.. autoclass:: AutoShardedClient
:members:
Voice
------
.. autoclass:: VoiceClient
:members:
.. autoclass:: AudioSource
:members:
.. autoclass:: PCMAudio
:members:
.. autoclass:: FFmpegPCMAudio
:members:
Opus Library
~~~~~~~~~~~~~