Skip to content

Commit 6cdd114

Browse files
committed
DOC: describe the SD_ENABLE_ASIO environment variable
1 parent 2748f70 commit 6cdd114

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

doc/installation.rst

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,35 @@ ASIO Support
4747
------------
4848

4949
Installing the ``sounddevice`` module with ``pip`` (on Windows)
50-
will provide PortAudio_ DLLs *without* ASIO support
50+
will provide two PortAudio_ DLLs, with and without ASIO support.
51+
By default, the DLL *without* ASIO support is loaded
5152
(because of the problems mentioned in `issue #496`__).
52-
To enable ASIO support, download the file
53-
`libportaudio64bit-asio.dll`__ or libportaudio32bit-asio.dll__
54-
and rename/move it as described in the next section.
53+
To load the DLL *with* ASIO support, the environment variable ``SD_ENABLE_ASIO``
54+
has to be set *before* importing the ``sounddevice`` module,
55+
for example like this:
56+
57+
.. code:: python
58+
59+
import os
60+
61+
# Set environment variable before importing sounddevice. Value is not important.
62+
os.environ["SD_ENABLE_ASIO"] = "1"
63+
64+
import sounddevice as sd
65+
66+
print(sd.query_hostapis())
5567
5668
__ https://github.com/spatialaudio/python-sounddevice/issues/496
57-
__ https://github.com/spatialaudio/portaudio-binaries/raw/master/libportaudio64bit-asio.dll
58-
__ https://github.com/spatialaudio/portaudio-binaries/raw/master/libportaudio32bit-asio.dll
69+
70+
.. note::
71+
72+
This will only work if the ``sounddevice`` module has been installed via ``pip``.
73+
This will not work with the ``conda`` package (see below).
74+
75+
.. note::
76+
77+
This will not work if a custom ``portaudio.dll`` is present in the ``%PATH%``
78+
(as described in the following section).
5979

6080

6181
Custom PortAudio Library

0 commit comments

Comments
 (0)