Setting up the Audio Interface in Windows

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:

1. Get a list of available interfaces:

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.

2. Create the device information file:

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.


DSPIllustrations.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com, amazon.de, amazon.co.uk, amazon.it.