use check implemented in python

This commit is contained in:
Jakob Ketterl 2021-09-29 17:23:23 +02:00
parent 8f36355817
commit 330598ddf2

View File

@ -526,19 +526,15 @@ class FeatureDetector(object):
You can find more information [here](https://github.com/jketterl/codecserver). You can find more information [here](https://github.com/jketterl/codecserver).
""" """
tmp_dir = CoreConfig().get_temporary_directory()
cmd = ["mbe_synthesizer", "--test"]
config = Config.get() config = Config.get()
server = ""
if "digital_voice_codecserver" in config: if "digital_voice_codecserver" in config:
cmd += ["--server", config["digital_voice_codecserver"]] server = config["digital_voice_codecserver"]
try: try:
process = subprocess.Popen( from digiham.modules import MbeSynthesizer
cmd, return MbeSynthesizer.hasAmbe(server)
stdin=subprocess.DEVNULL, except ImportError:
stdout=subprocess.DEVNULL, return False
stderr=subprocess.DEVNULL, except ConnectionError:
cwd=tmp_dir,
)
return process.wait() == 0
except FileNotFoundError:
return False return False