This commit is contained in:
Dmytro Bogovych 2023-08-24 11:33:44 +03:00
parent 9504a2295c
commit bf60346fc7
1 changed files with 7 additions and 8 deletions

View File

@ -16,6 +16,7 @@ import utils_cache
from bt_controller import Bluetoothctl
import bt_signal
from bt_signal import SignalBoundaries
import bt_call_controller
import multiprocessing
import signal
@ -268,14 +269,12 @@ def make_call(target: str):
utils.log(f' Done.')
# Compose a command
utils.close_log_file()
cmd = f'/usr/bin/python3 {DIR_THIS}/bt_call_controller.py --play-file {reference_filename} --record-file {record_file} --timelimit {reference_length} --target {target}'
retcode = os.system(cmd)
utils.open_log_file(LOG_FILEPATH, 'at')
if retcode != 0:
utils.log_error(f'BT caller script exited with non-zero code {retcode}, skipping analysis.')
else:
# utils.close_log_file()
try:
bt_call_controller.run(play_file=reference_filename, record_file=record_file, timelimit_seconds=reference_length, target=target)
run_analyze(record_file, REFERENCE_AUDIO, target)
except Exception as e:
utils.log_error(f'BT I/O failed finally. Error: {str(e)}')
def perform_answerer():