I'm working on a project where I have to control 8 audio channel. I'm programming in python3 using alsaaudio library. It all worked but I have these 3 errors and, once I start the program, my internet connection goes down.
In the following code, you can see how I initialize the device (octosound card by AudioInjector). Please note that if the indentitation is wrong is just because a copy paste error.
import alsaaudio
def start_device(ch):
variables.mut.acquire()
if variables.device_flag[ch] == 1:
try:
variables.device_PCM[ch] = alsaaudio.PCM(type=alsaaudio.PCM_PLAYBACK, mode = alsaaudio.PCM_NORMAL,device=variables.device_name[ch])
variables.device_flag[ch] = 0 # device open
print('device -%s- OPEN' % (variables.device_name[ch]))
except:
print("Except raised")
json_builder.jsonerror("Init device ch" + str(ch) +" FAILED to OPEN",ch)
variables.device_flag[ch] == 1
else:
print("Device -%s- already opened" % (variables.device_name[ch]))
variables.mut.release()
The strange things are that this code works and I can drive all 8 channels but I got 3 errors and my internet stop working:
message: "Module 'alsaaudio' has no 'PCM' member"
message: "Module 'alsaaudio' has no 'PCM_PLAYBACK' member"
message: "Module 'alsaaudio' has no 'PCM_NORMAL' member"
(the device=device_name[ch] works, no error)