Browse Source

Documentation fixes for opus bindings.

pull/57/head
Rapptz 9 years ago
parent
commit
9deb7796a5
  1. 36
      discord/opus.py
  2. 1
      docs/api.rst

36
discord/opus.py

@ -80,25 +80,33 @@ def load_opus(name):
"""Loads the libopus shared library for use with voice. """Loads the libopus shared library for use with voice.
If this function is not called then the library uses the function If this function is not called then the library uses the function
``ctypes.util.find_library`` and then loads that one if available. `ctypes.util.find_library <find_library>` and then loads that one
if available.
.. find_library: https://docs.python.org/3.5/library/ctypes.html#finding-shared-libraries
Not loading a library leads to voice not working. Not loading a library leads to voice not working.
This function propagates the exceptions thrown. This function propagates the exceptions thrown.
.. warning:: Warning
--------
The bitness of the library must match the bitness of your python The bitness of the library must match the bitness of your python
interpreter. If the library is 64-bit then your python interpreter interpreter. If the library is 64-bit then your python interpreter
must be 64-bit as well. Usually if there's a mismatch in bitness then must be 64-bit as well. Usually if there's a mismatch in bitness then
the load will throw an exception. the load will throw an exception.
.. note:: Note
----
On Windows, the .dll extension is not necessary. However, on Linux 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``. 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
:param name: The filename of the shared library. without you having to call this.
Parameters
----------
name: str
The filename of the shared library.
""" """
global _lib global _lib
_lib = libopus_loader(name) _lib = libopus_loader(name)

1
docs/api.rst

@ -457,3 +457,4 @@ The following exceptions are thrown by the library.
.. autoexception:: GatewayNotFound .. autoexception:: GatewayNotFound
.. autoexception:: OpusError

Loading…
Cancel
Save