0

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)

Giulio
  • 150
  • 2
  • 11

1 Answers1

0

Well, I will recommend you to use Alvas.Audio Library which can edit, convert, play, pause convert audio files. The C# Alvas.Audio library can also be used to convert headerless format (SLINEAR) etc. http://alvas.net/alvas.audio,tips.aspx Moreover it helps to extract AVI streams and convert one file format to another. So, try the Alvas.Audio C# library and get free trial https://www.filerepairtools.com/alavas-audio-library.html