When using Windows, the audio device cannot be chosen automatically, but it must be selected manually. If you do not set the audio device, there will be a runtime error each time you use the =AudioChannel= object.
Here's how to set the audio interface:
Within the installed virtual environment, open a Python terminal and enter the command python -m sounddevice
.
The output is a list of all available devices. Identify both the input and output device you want to use.
Create a file audiodevice.txt
in the folder, where all the Jupyter notebooks reside (The error message when no device is selected will mention the name of the expected file).
Insert two lines into the file: The first line contains the input device name, the second line contains the output device name. For example (referring to the screenshot above), the file contents could be
Microphone (USB Audio Device), MME
Speakers (USB Audio Device), MME
Save the file, and now the audio device should be correctly working.