Skip to content

Commit 14de398

Browse files
committed
CONTRIBUTING: Add section about creating a Github issue
1 parent 08f5fd4 commit 14de398

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

CONTRIBUTING.rst

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,83 @@ https://github.com/spatialaudio/python-sounddevice/.
77
Contributions are always welcome!
88

99

10+
Reporting Problems
11+
------------------
12+
13+
When creating an issue at
14+
https://github.com/spatialaudio/python-sounddevice/issues,
15+
please make sure to provide as much useful information as possible.
16+
17+
You can use Markdown formatting to show Python code, e.g. ::
18+
19+
I have created a script named `my_script.py`:
20+
21+
```python
22+
import sounddevice as sd
23+
24+
fs = 48000
25+
duration = 1.5
26+
27+
data = sd.rec(int(duration * fs), channels=99)
28+
sd.wait()
29+
print(data.shape)
30+
```
31+
32+
Please provide minimal code
33+
(remove everything that's not necessary to show the problem),
34+
but make sure that the code example still has everything that's needed to run it,
35+
including all ``import`` statements.
36+
37+
You should of course also show what happens when you run your code, e.g. ::
38+
39+
Running my script, I got this error:
40+
41+
```
42+
$ python3 my_script.py
43+
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
44+
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818
45+
Traceback (most recent call last):
46+
File "my_script.py", line 6, in <module>
47+
data = sd.rec(int(duration * fs), channels=99)
48+
...
49+
sounddevice.PortAudioError: Error opening InputStream: Invalid number of channels [PaErrorCode -9998]
50+
```
51+
52+
Please remember to provide the full command invocation and the full output.
53+
You should only remove lines of output when you know they are irrelevant.
54+
55+
You should also mention the operating system and host API you are using
56+
(e.g. "Linux/ALSA" or "macOS/Core Audio" or "Windows/WASAPI").
57+
58+
If your problem is related to a certain hardware device,
59+
you should provide the list of devices as reported by ::
60+
61+
python3 -m sounddevice
62+
63+
If your problem has to do with the version of the PortAudio library you are using,
64+
you should provide the output of this script::
65+
66+
import sounddevice as sd
67+
print(sd._libname)
68+
print(sd.get_portaudio_version())
69+
70+
If you don't want to clutter the issue description with a huge load of gibberish,
71+
you can use the ``<details>`` HTML tag to show some content only on demand::
72+
73+
<details>
74+
75+
```
76+
$ python3 -m sounddevice
77+
0 Built-in Line Input, Core Audio (2 in, 0 out)
78+
> 1 Built-in Digital Input, Core Audio (2 in, 0 out)
79+
< 2 Built-in Output, Core Audio (0 in, 2 out)
80+
3 Built-in Line Output, Core Audio (0 in, 2 out)
81+
4 Built-in Digital Output, Core Audio (0 in, 2 out)
82+
```
83+
84+
</details>
85+
86+
1087
Development Installation
1188
------------------------
1289

0 commit comments

Comments
 (0)