mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
fix problem with libasound.so
This commit is contained in:
parent
c386b3608a
commit
bbb500632e
|
@ -209,8 +209,15 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
|||
data["DAEMON_STATE"].append({"STATUS": "stopped"})
|
||||
|
||||
# UPDATE LIST OF AUDIO DEVICES
|
||||
try:
|
||||
# we need to "try" this, because sometimes libasound.so isn't in the default place
|
||||
# try to supress error messages
|
||||
with noalsaerr(): # https://github.com/DJ2LS/FreeDATA/issues/22
|
||||
p = pyaudio.PyAudio()
|
||||
# else do it the default way
|
||||
except:
|
||||
p = pyaudio.Pyaudio()
|
||||
|
||||
for i in range(0, p.get_device_count()):
|
||||
|
||||
maxInputChannels = p.get_device_info_by_host_api_device_index(
|
||||
|
|
|
@ -111,9 +111,14 @@ class RF():
|
|||
self.c_lib = ctypes.CDLL(libname)
|
||||
print("running libcodec from EXTERNAL library")
|
||||
# --------------------------------------------CREATE PYAUDIO INSTANCE
|
||||
|
||||
try:
|
||||
# we need to "try" this, because sometimes libasound.so isn't in the default place
|
||||
# try to supress error messages
|
||||
with noalsaerr(): # https://github.com/DJ2LS/FreeDATA/issues/22
|
||||
self.p = pyaudio.PyAudio()
|
||||
# else do it the default way
|
||||
except:
|
||||
self.p = pyaudio.PyAudio()
|
||||
atexit.register(self.p.terminate)
|
||||
# --------------------------------------------OPEN AUDIO CHANNEL RX
|
||||
self.stream_rx = self.p.open(format=pyaudio.paInt16,
|
||||
|
|
Loading…
Reference in a new issue