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
2 changed files with 17 additions and 5 deletions
|
@ -209,8 +209,15 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||||
data["DAEMON_STATE"].append({"STATUS": "stopped"})
|
data["DAEMON_STATE"].append({"STATUS": "stopped"})
|
||||||
|
|
||||||
# UPDATE LIST OF AUDIO DEVICES
|
# UPDATE LIST OF AUDIO DEVICES
|
||||||
with noalsaerr(): # https://github.com/DJ2LS/FreeDATA/issues/22
|
try:
|
||||||
p = pyaudio.PyAudio()
|
# 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()):
|
for i in range(0, p.get_device_count()):
|
||||||
|
|
||||||
maxInputChannels = p.get_device_info_by_host_api_device_index(
|
maxInputChannels = p.get_device_info_by_host_api_device_index(
|
||||||
|
|
|
@ -111,8 +111,13 @@ class RF():
|
||||||
self.c_lib = ctypes.CDLL(libname)
|
self.c_lib = ctypes.CDLL(libname)
|
||||||
print("running libcodec from EXTERNAL library")
|
print("running libcodec from EXTERNAL library")
|
||||||
# --------------------------------------------CREATE PYAUDIO INSTANCE
|
# --------------------------------------------CREATE PYAUDIO INSTANCE
|
||||||
|
try:
|
||||||
with noalsaerr(): # https://github.com/DJ2LS/FreeDATA/issues/22
|
# 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()
|
self.p = pyaudio.PyAudio()
|
||||||
atexit.register(self.p.terminate)
|
atexit.register(self.p.terminate)
|
||||||
# --------------------------------------------OPEN AUDIO CHANNEL RX
|
# --------------------------------------------OPEN AUDIO CHANNEL RX
|
||||||
|
|
Loading…
Reference in a new issue