I am using this Github repo to guide me in my process to create a Flask application that can detect your mood via your voice. To build the application I was on Windows 10 using Pycharm and Python 3.6. Everything works fine and I have no issues as you can see with this output: successful output.
My problems arise when I clone my app to my Ubuntu subsystem on my Windows machine or my Google VM running Ubuntu 18. When I try to record my voice I get this error: OSError: [Errno -9996] Invalid output device (no default output device)
(full error here).
I have seen this Stackoverflow post get linked many times when encountering this error but none of the answers fixed my issue.
When I run this code
>>> import pyaudio
>>> pa = pyaudio.PyAudio()
>>> pa.get_default_input_device_info()
I get this ouput
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ian/app/env/lib/python3.6/site-packages/pyaudio.py", line 949, in get_default_input_device_info
device_index = pa.get_default_input_device()
OSError: No Default Input Device Available