From 3c9bcc285147154a2980f6e661efdfa676672b6a Mon Sep 17 00:00:00 2001 From: NCPlayz Date: Sat, 18 May 2019 06:04:54 -0400 Subject: Improve documentation --- discord/opus.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'discord/opus.py') diff --git a/discord/opus.py b/discord/opus.py index c37be248..70ed8056 100644 --- a/discord/opus.py +++ b/discord/opus.py @@ -115,21 +115,13 @@ def load_opus(name): """Loads the libopus shared library for use with voice. If this function is not called then the library uses the function - `ctypes.util.find_library`__ and then loads that one + :func:`ctypes.util.find_library` and then loads that one if available. - .. _find library: https://docs.python.org/3.5/library/ctypes.html#finding-shared-libraries - __ `find library`_ - Not loading a library leads to voice not working. This function propagates the exceptions thrown. - .. note:: - - On Windows, this function should not need to be called as the binaries - are automatically loaded. - .. warning:: The bitness of the library must match the bitness of your python @@ -137,11 +129,16 @@ def load_opus(name): must be 64-bit as well. Usually if there's a mismatch in bitness then the load will throw an exception. + .. note:: + + On Windows, this function should not need to be called as the binaries + are automatically loaded. + .. note:: On Windows, the .dll extension is not necessary. However, on Linux the full extension is required to load the library, e.g. ``libopus.so.1``. - On Linux however, `find library`_ will usually find the library automatically + On Linux however, :func:`ctypes.util.find_library` will usually find the library automatically without you having to call this. Parameters @@ -154,7 +151,7 @@ def load_opus(name): def is_loaded(): """Function to check if opus lib is successfully loaded either - via the ``ctypes.util.find_library`` call of :func:`load_opus`. + via the :func:`ctypes.util.find_library` call of :func:`load_opus`. This must return ``True`` for voice to work. -- cgit v1.2.3