Skip to content

Commit 9217a2b

Browse files
committed
DOC: more documentation for device selection
1 parent aa3f673 commit 9217a2b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,17 @@ You can use the corresponding device ID to select a desired device by assigning
211211
to `sounddevice.default.device` or by passing it as *device* argument to
212212
`sounddevice.play()`, `sounddevice.Stream()` etc.
213213

214+
Instead of the numerical device ID, you can also use a space-separated list of
215+
case-insensitive substrings of the device name (and the host API name, if
216+
needed). See `sounddevice.default.device` for details.
217+
218+
.. code:: python
219+
220+
import sounddevice as sd
221+
sd.default.samplerate = 44100
222+
sd.default.device = 'digital output'
223+
sd.play(myarray)
224+
214225
Callback Streams
215226
^^^^^^^^^^^^^^^^
216227

0 commit comments

Comments
 (0)